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:38:29 +0300 |
commit | e40fe90cf4c630e9930a897596212925907202eb (patch) | |
tree | 3a71acf92d3b2c49842a6b98f39c5bc333bc821a /protocols/JabberG/src | |
parent | 21cb5066d970dde709000cdae89c7f8e89addac7 (diff) |
fixes #1917 (Jabber p2p file transfer not working anymore)
Diffstat (limited to 'protocols/JabberG/src')
-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);
|