diff options
author | George Hazan <ghazan@miranda.im> | 2019-04-11 20:38:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-04-11 20:39:23 +0300 |
commit | 6c4136504c660bf3359e6641362672c4b9502be5 (patch) | |
tree | 2515d0849b3c6ab4c0070857fed6bd7e1cbbaf2d | |
parent | 0efd9faae962ad4116b97797956b5e4f25ce344c (diff) |
fixes #1917 (Jabber p2p file transfer not working anymore)
(cherry picked from commit e40fe90cf4c630e9930a897596212925907202eb)
-rw-r--r-- | protocols/JabberG/src/jabber_byte.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index 205e146c30..5d89502c94 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -215,7 +215,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) localAddr = Netlib_AddressToString(&sin);
}
- itoa(nlb.wPort, szPort, 8);
+ itoa(nlb.wPort, szPort, 10);
JABBER_LIST_ITEM *item = ListAdd(LIST_BYTE, szPort);
item->jbt = jbt;
hEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
@@ -366,16 +366,10 @@ int CJabberProto::ByteSendParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jbt, ch // 04-07 bnd.addr server bound address
// 08-09 bnd.port server bound port
if (datalen == 47 && *((DWORD*)buffer) == 0x03000105 && buffer[4] == 40 && *((WORD*)(buffer + 45)) == 0) {
- wchar_t text[256];
-
- char *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
- char *szTargetJid = JabberPrepareJid(jbt->dstJID);
- mir_snwprintf(text, L"%s%s%s", jbt->sid, szInitiatorJid, szTargetJid);
- mir_free(szInitiatorJid);
- mir_free(szTargetJid);
-
- T2Utf szAuthString(text);
- debugLogA("Auth: '%s'", szAuthString);
+ ptrA szInitiatorJid(JabberPrepareJid(jbt->srcJID));
+ ptrA szTargetJid(JabberPrepareJid(jbt->dstJID));
+ CMStringA szAuthString(FORMAT, "%s%s%s", jbt->sid, szInitiatorJid.get(), szTargetJid.get());
+ debugLogA("Auth: '%s'", szAuthString.c_str());
JabberShaStrBuf buf;
JabberSha1(szAuthString, buf);
|