diff options
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r-- | protocols/JabberG/src/jabber_byte.cpp | 6 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_file.cpp | 4 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_thread.cpp | 12 |
3 files changed, 9 insertions, 13 deletions
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index deefa4ebe7..95a9976176 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -91,8 +91,8 @@ void JabberByteSendConnection(HANDLE hConn, DWORD /*dwRemoteIP*/, void* extra) char* buffer;
int datalen;
- NETLIBCONNINFO connInfo = { sizeof(connInfo) };
- CallService(MS_NETLIB_GETCONNECTIONINFO, (WPARAM)hConn, (LPARAM)&connInfo);
+ NETLIBCONNINFO connInfo = {};
+ Netlib_GetConnectionInfo(hConn, &connInfo);
mir_snwprintf(szPort, L"%u", connInfo.wPort);
ppro->debugLogA("bytestream_send_connection incoming connection accepted: %s", connInfo.szIpPort);
@@ -220,7 +220,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) jbt->hSendEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
query << XCHILD(L"streamhost") << XATTR(L"jid", m_ThreadInfo->fullJID) << XATTR(L"host", _A2T(localAddr)) << XATTRI(L"port", nlb.wPort);
- NETLIBIPLIST* ihaddr = (NETLIBIPLIST*)CallService(MS_NETLIB_GETMYIP, 1, 0);
+ NETLIBIPLIST* ihaddr = Netlib_GetMyIp(true);
for (unsigned i=0; i < ihaddr->cbNum; i++)
if (mir_strcmp(localAddr, ihaddr->szIp[i]))
query << XCHILD(L"streamhost") << XATTR(L"jid", m_ThreadInfo->fullJID) << XATTR(L"host", _A2T(ihaddr->szIp[i])) << XATTRI(L"port", nlb.wPort);
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index ff95251f6f..2ac8d9b0c3 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -175,8 +175,8 @@ void JabberFileServerConnection(JABBER_SOCKET hConnection, DWORD /*dwRemoteIP*/, {
CJabberProto *ppro = (CJabberProto*)extra;
- NETLIBCONNINFO connInfo = { sizeof(connInfo) };
- CallService(MS_NETLIB_GETCONNECTIONINFO, (WPARAM)hConnection, (LPARAM)&connInfo);
+ NETLIBCONNINFO connInfo = {};
+ Netlib_GetConnectionInfo(hConnection, &connInfo);
wchar_t szPort[10];
mir_snwprintf(szPort, L"%d", connInfo.wPort);
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index af32ff56cc..778a2b72e8 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -375,7 +375,7 @@ LBL_FatalError: // Determine local IP
if (info.conn.useSSL) {
debugLogA("Intializing SSL connection");
- if (!CallService(MS_NETLIB_STARTSSL, (WPARAM)info.s, 0)) {
+ if (!Netlib_StartSsl(info.s, NULL)) {
debugLogA("SSL intialization failed");
if (!info.bIsReg)
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
@@ -413,11 +413,10 @@ LBL_FatalError: if (dwIdle >= dwConnectionKeepAliveInterval)
dwIdle = dwConnectionKeepAliveInterval - 10; // now!
- NETLIBSELECT nls = { 0 };
- nls.cbSize = sizeof(NETLIBSELECT);
+ NETLIBSELECT nls = {};
nls.dwTimeout = dwConnectionKeepAliveInterval - dwIdle;
nls.hReadConns[0] = info.s;
- int nSelRes = CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls);
+ int nSelRes = Netlib_Select(&nls);
if (nSelRes == -1) // error
break;
else if (nSelRes == 0 && m_bSendKeepAlive) {
@@ -905,10 +904,7 @@ void CJabberProto::OnProcessProceed(HXML node, ThreadData *info) bool isHosted = gtlk && !gtlk[10] && mir_strcmpi(info->conn.server, "gmail.com") &&
mir_strcmpi(info->conn.server, "googlemail.com");
- NETLIBSSL ssl = { 0 };
- ssl.cbSize = sizeof(ssl);
- ssl.host = isHosted ? info->conn.manualHost : info->conn.server;
- if (!CallService(MS_NETLIB_STARTSSL, (WPARAM)info->s, (LPARAM)&ssl)) {
+ if (!Netlib_StartSsl(info->s, isHosted ? info->conn.manualHost : info->conn.server)) {
debugLogA("SSL initialization failed");
info->send("</stream:stream>");
info->shutdown();
|