diff options
author | George Hazan <ghazan@miranda.im> | 2022-05-07 15:00:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-05-07 15:00:02 +0300 |
commit | c4ffab658f422e84259a0a9769f0003b33a013bd (patch) | |
tree | 667448a4911b47f72acbb82a0142e13ddefb3b6d /protocols/JabberG/src/jabber_byte.cpp | |
parent | fd1ca33248519ee530d1d05c6a451c9c63bf4e8a (diff) |
Netlib_OpenConnection - finally old stupid structure NETLIBOPENCONNECTION died and converted into a set of parameters + code cleaning
Diffstat (limited to 'protocols/JabberG/src/jabber_byte.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_byte.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index 48c3c02463..685174347d 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -438,15 +438,9 @@ void CJabberProto::ByteSendViaProxy(JABBER_BYTE_TRANSFER *jbt) char *szPort = jbt->szProxyPort;
char *szHost = jbt->szProxyHost;
- uint16_t port = (uint16_t)atoi(szPort);
replaceStr(jbt->streamhostJID, jbt->szProxyJid);
- NETLIBOPENCONNECTION nloc = {};
- nloc.szHost = szHost;
- nloc.wPort = port;
-
- HNETLIBCONN hConn = Netlib_OpenConnection(m_hNetlibUser, &nloc);
- mir_free((void*)nloc.szHost);
+ HNETLIBCONN hConn = Netlib_OpenConnection(m_hNetlibUser, szHost, atoi(szPort));
if (hConn != nullptr) {
jbt->hConn = hConn;
@@ -610,13 +604,7 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt) replaceStr(jbt->streamhostJID, str);
debugLogA("bytestream_recv connecting to %s:%d", szHost, port);
- NETLIBOPENCONNECTION nloc = { 0 };
- nloc.szHost = mir_strdup(szHost);
- nloc.wPort = port;
-
- HNETLIBCONN hConn = Netlib_OpenConnection(m_hNetlibUser, &nloc);
- mir_free((void*)nloc.szHost);
-
+ HNETLIBCONN hConn = Netlib_OpenConnection(m_hNetlibUser, szHost, port);
if (hConn == nullptr) {
debugLogA("bytestream_recv_connection connection failed (%d), try next streamhost", WSAGetLastError());
continue;
|