From c4ffab658f422e84259a0a9769f0003b33a013bd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 7 May 2022 15:00:02 +0300 Subject: Netlib_OpenConnection - finally old stupid structure NETLIBOPENCONNECTION died and converted into a set of parameters + code cleaning --- protocols/JabberG/src/jabber_byte.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'protocols/JabberG/src/jabber_byte.cpp') 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; -- cgit v1.2.3