From e145db68fb5b7d0682a4b2be0174cebfe47dd74e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 13 Jan 2017 00:01:59 +0300 Subject: a bit less netlib services --- protocols/MSN/src/msn_p2p.cpp | 2 +- protocols/MSN/src/msn_proto.cpp | 12 +++++++----- protocols/MSN/src/msn_threads.cpp | 6 +++--- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'protocols/MSN') 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) -- cgit v1.2.3