diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-13 17:47:33 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-13 17:47:33 +0300 |
commit | 20a9f536e44c3928ad8c3cf7a2959bce557dab8e (patch) | |
tree | 0b17f148a4155a1ead90bb106e21b3542f2572e0 /protocols/MSN | |
parent | e145db68fb5b7d0682a4b2be0174cebfe47dd74e (diff) |
(wiping blood from hands) no more netlib services
Diffstat (limited to 'protocols/MSN')
-rw-r--r-- | protocols/MSN/src/msn_commands.cpp | 4 | ||||
-rw-r--r-- | protocols/MSN/src/msn_http.cpp | 5 | ||||
-rw-r--r-- | protocols/MSN/src/msn_misc.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_threads.cpp | 12 | ||||
-rw-r--r-- | protocols/MSN/src/msn_ws.cpp | 12 |
5 files changed, 16 insertions, 19 deletions
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index cdea188a44..58391b4b29 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -1410,8 +1410,8 @@ void MSN_ConnectionProc(HANDLE hNewConnection, DWORD /* dwRemoteIP */, void* ext proto->debugLogA("File transfer connection accepted");
- NETLIBCONNINFO connInfo = { sizeof(connInfo) };
- CallService(MS_NETLIB_GETCONNECTIONINFO, (WPARAM)hNewConnection, (LPARAM)&connInfo);
+ NETLIBCONNINFO connInfo = {};
+ Netlib_GetConnectionInfo(hNewConnection, &connInfo);
ThreadData* T = proto->MSN_GetThreadByPort(connInfo.wPort);
if (T != NULL && T->s == NULL) {
diff --git a/protocols/MSN/src/msn_http.cpp b/protocols/MSN/src/msn_http.cpp index 74a0f66fb7..f280daa823 100644 --- a/protocols/MSN/src/msn_http.cpp +++ b/protocols/MSN/src/msn_http.cpp @@ -38,13 +38,12 @@ static ThreadData* FindThreadConn(HANDLE hConn) int msn_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION*, NETLIBHTTPREQUEST*)
{
- NETLIBHTTPPROXYINFO nlhpi = { 0 };
- nlhpi.cbSize = sizeof(nlhpi);
+ NETLIBHTTPPROXYINFO nlhpi = {};
nlhpi.szHttpGetUrl = NULL;
nlhpi.szHttpPostUrl = "messenger.hotmail.com";
nlhpi.flags = NLHPIF_HTTP11;
nlhpi.combinePackets = MSN_PACKETS_COMBINE;
- return CallService(MS_NETLIB_SETHTTPPROXYINFO, (WPARAM)hConn, (LPARAM)&nlhpi);
+ return Netlib_SetHttpProxyInfo(hConn, &nlhpi);
}
//=======================================================================================
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 2f89d21fbe..cc620c1dc1 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -1396,7 +1396,7 @@ void MSN_MakeDigest(const char* chl, char* dgst) char* GetGlobalIp(void)
{
- NETLIBIPLIST* ihaddr = (NETLIBIPLIST*)CallService(MS_NETLIB_GETMYIP, 1, 0);
+ NETLIBIPLIST *ihaddr = Netlib_GetMyIp(true);
for (unsigned i = 0; i < ihaddr->cbNum; ++i)
if (strchr(ihaddr->szIp[i], ':'))
return mir_strdup(ihaddr->szIp[i]);
diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp index de17faa243..c3888ba028 100644 --- a/protocols/MSN/src/msn_threads.cpp +++ b/protocols/MSN/src/msn_threads.cpp @@ -177,7 +177,7 @@ void __cdecl CMsnProto::MSNServerThread(void* arg) }
if (usingGateway)
- CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(info->s), info->mGatewayTimeout);
+ Netlib_SetPollingTimeout(info->s, info->mGatewayTimeout);
debugLogA("Connected with handle=%08X", info->s);
@@ -318,8 +318,7 @@ void CMsnProto::MSN_CloseConnections(void) {
mir_cslockfull lck(m_csThreads);
- NETLIBSELECTEX nls = { 0 };
- nls.cbSize = sizeof(nls);
+ NETLIBSELECTEX nls = {};
for (int i = 0; i < m_arThreads.getCount(); i++) {
ThreadData &T = m_arThreads[i];
@@ -329,7 +328,7 @@ void CMsnProto::MSN_CloseConnections(void) case SERVER_SWITCHBOARD:
if (T.s != NULL && !T.sessionClosed && !T.termPending) {
nls.hReadConns[0] = T.s;
- int res = CallService(MS_NETLIB_SELECTEX, 0, (LPARAM)&nls);
+ int res = Netlib_SelectEx(&nls);
if (res >= 0 || nls.hReadStatus[0] == 0)
T.sendTerminate();
}
@@ -616,13 +615,12 @@ void ThreadData::applyGatewayData(HANDLE hConn, bool isPoll) proto->debugLogA("applying '%s' to %08X [%08X]", szHttpPostUrl, this, GetCurrentThreadId());
- NETLIBHTTPPROXYINFO nlhpi = { 0 };
- nlhpi.cbSize = sizeof(nlhpi);
+ NETLIBHTTPPROXYINFO nlhpi = {};
nlhpi.flags = NLHPIF_HTTP11;
nlhpi.szHttpGetUrl = NULL;
nlhpi.szHttpPostUrl = szHttpPostUrl;
nlhpi.combinePackets = 5;
- CallService(MS_NETLIB_SETHTTPPROXYINFO, (WPARAM)hConn, (LPARAM)&nlhpi);
+ Netlib_SetHttpProxyInfo(hConn, &nlhpi);
}
void ThreadData::getGatewayUrl(char* dest, int destlen, bool isPoll)
diff --git a/protocols/MSN/src/msn_ws.cpp b/protocols/MSN/src/msn_ws.cpp index 1c7dcd07e9..c82c660e8f 100644 --- a/protocols/MSN/src/msn_ws.cpp +++ b/protocols/MSN/src/msn_ws.cpp @@ -31,7 +31,7 @@ int ThreadData::send(const char data[], size_t datalen) if (proto->usingGateway && !(mType == SERVER_FILETRANS || mType == SERVER_P2P_DIRECT)) {
mGatewayTimeout = 2;
- CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(s), mGatewayTimeout);
+ Netlib_SetPollingTimeout(s, mGatewayTimeout);
}
int rlen = Netlib_Send(s, data, (int)datalen);
@@ -113,13 +113,13 @@ int ThreadData::recv(char* data, size_t datalen) {
if (!proto->usingGateway) {
resetTimeout();
- NETLIBSELECT nls = { 0 };
- nls.cbSize = sizeof(nls);
+
+ NETLIBSELECT nls = {};
nls.dwTimeout = 1000;
nls.hReadConns[0] = s;
for (;;) {
- int ret = CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls);
+ int ret = Netlib_Select(&nls);
if (ret < 0) {
proto->debugLogA("Connection abortively closed, error %d", WSAGetLastError());
return ret;
@@ -149,13 +149,13 @@ LBL_RecvAgain: if (sessionClosed || isTimeout()) return 0;
if ((mGatewayTimeout += 2) > 20) mGatewayTimeout = 20;
- CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(s), mGatewayTimeout);
+ Netlib_SetPollingTimeout(s, mGatewayTimeout);
goto LBL_RecvAgain;
}
else {
resetTimeout();
mGatewayTimeout = 1;
- CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(s), mGatewayTimeout);
+ Netlib_SetPollingTimeout(s, mGatewayTimeout);
}
}
|