diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-13 00:01:59 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-13 00:01:59 +0300 |
commit | e145db68fb5b7d0682a4b2be0174cebfe47dd74e (patch) | |
tree | c8f9edc907876d236eb16bc8ca8b592accb9846f /protocols/MSN/src | |
parent | 3cb3883908e3168e5f955be3143771721614307a (diff) |
a bit less netlib services
Diffstat (limited to 'protocols/MSN/src')
-rw-r--r-- | protocols/MSN/src/msn_p2p.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_proto.cpp | 12 | ||||
-rw-r--r-- | protocols/MSN/src/msn_threads.cpp | 6 |
3 files changed, 11 insertions, 9 deletions
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp index 9785717103..2c81a6ecc0 100644 --- a/protocols/MSN/src/msn_p2p.cpp +++ b/protocols/MSN/src/msn_p2p.cpp @@ -682,7 +682,7 @@ bool CMsnProto::p2p_connectTo(ThreadData* info, directconnection *dc) debugLogA("Connecting to %s:%d", tConn.szHost, tConn.wPort);
- info->s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&tConn);
+ info->s = (HANDLE)Netlib_OpenConnection(m_hNetlibUser, (LPARAM)&tConn);
if (info->s == NULL) {
TWinErrorCode err;
debugLogA("Connection Failed (%d): %s", err.mErrorCode, err.getText());
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 0f1a20f5fd..a938b42be9 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -538,10 +538,11 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg) NETLIBOPENCONNECTION nloc = { 0 };
MyNetlibConnFromUrl(nlhr.szUrl, nloc);
nloc.flags |= NLOCF_HTTP;
- if (nloc.flags & NLOCF_SSL) nlhr.flags |= NLHRF_SSL;
- HANDLE nlc = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&nloc);
-
- if (nlc && CallService(MS_NETLIB_SENDHTTPREQUEST, (WPARAM)nlc, (LPARAM)&nlhr) != SOCKET_ERROR && (nlhrReply = Netlib_RecvHttpHeaders(nlc))) {
+ if (nloc.flags & NLOCF_SSL)
+ nlhr.flags |= NLHRF_SSL;
+
+ HANDLE nlc = Netlib_OpenConnection(m_hNetlibUser, &nloc);
+ if (nlc && Netlib_SendHttpRequest(nlc, &nlhr) != SOCKET_ERROR && (nlhrReply = Netlib_RecvHttpHeaders(nlc))) {
if (nlhrReply->resultCode == 200 || nlhrReply->resultCode == 206) {
INT_PTR dw;
char buf[1024];
@@ -562,7 +563,8 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg) }
Netlib_CloseHandle(nlc);
mir_free((char*)nloc.szHost);
- if (ft->std.currentFileNumber >= ft->std.totalFiles) ft->complete();
+ if (ft->std.currentFileNumber >= ft->std.totalFiles)
+ ft->complete();
}
delete ft;
}
diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp index 2bddaea516..de17faa243 100644 --- a/protocols/MSN/src/msn_threads.cpp +++ b/protocols/MSN/src/msn_threads.cpp @@ -160,7 +160,7 @@ void __cdecl CMsnProto::MSNServerThread(void* arg) debugLogA("Thread started: server='%s:%d', type=%d", tConn.szHost, tConn.wPort, info->mType);
- info->s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&tConn);
+ info->s = Netlib_OpenConnection(m_hNetlibUser, &tConn);
if (info->s == NULL) {
debugLogA("Connection Failed (%d) server='%s:%d'", WSAGetLastError(), tConn.szHost, tConn.wPort);
@@ -336,7 +336,7 @@ void CMsnProto::MSN_CloseConnections(void) break;
case SERVER_P2P_DIRECT:
- CallService(MS_NETLIB_SHUTDOWN, (WPARAM)T.s, 0);
+ Netlib_Shutdown(T.s);
break;
}
}
@@ -344,7 +344,7 @@ void CMsnProto::MSN_CloseConnections(void) lck.unlock();
if (hHttpsConnection)
- CallService(MS_NETLIB_SHUTDOWN, (WPARAM)hHttpsConnection, 0);
+ Netlib_Shutdown(hHttpsConnection);
}
void CMsnProto::Threads_Uninit(void)
|