From d3cb19278d60ac6f7963379254546cdca36a90e2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 14 Jan 2017 01:22:55 +0300 Subject: separate handle types for HNETLIBCONN & HNETLIBBIND --- protocols/MSN/src/msn_http.cpp | 6 +++--- protocols/MSN/src/msn_proto.cpp | 10 +++++----- protocols/MSN/src/msn_proto.h | 2 +- protocols/MSN/src/msn_threads.cpp | 4 ++-- protocols/MSN/src/stdafx.h | 12 ++++++------ 5 files changed, 17 insertions(+), 17 deletions(-) (limited to 'protocols/MSN/src') diff --git a/protocols/MSN/src/msn_http.cpp b/protocols/MSN/src/msn_http.cpp index f280daa823..243b7b6967 100644 --- a/protocols/MSN/src/msn_http.cpp +++ b/protocols/MSN/src/msn_http.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . #include "stdafx.h" #include "msn_proto.h" -static ThreadData* FindThreadConn(HANDLE hConn) +static ThreadData* FindThreadConn(HNETLIBCONN hConn) { ThreadData *res = NULL; for (int i = 0; i < g_Instances.getCount() && res == NULL; ++i) @@ -36,7 +36,7 @@ static ThreadData* FindThreadConn(HANDLE hConn) // Fake function - it does nothing but confirms successful session initialization //======================================================================================= -int msn_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION*, NETLIBHTTPREQUEST*) +int msn_httpGatewayInit(HNETLIBCONN hConn, NETLIBOPENCONNECTION*, NETLIBHTTPREQUEST*) { NETLIBHTTPPROXYINFO nlhpi = {}; nlhpi.szHttpGetUrl = NULL; @@ -51,7 +51,7 @@ int msn_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION*, NETLIBHTTPREQUEST*) // function generates the initial URL depending on a thread type //======================================================================================= -int msn_httpGatewayWrapSend(HANDLE hConn, PBYTE buf, int len, int flags) +int msn_httpGatewayWrapSend(HNETLIBCONN hConn, PBYTE buf, int len, int flags) { ThreadData *T = FindThreadConn(hConn); if (T != NULL) { diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index a938b42be9..b93d1a1903 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -23,10 +23,10 @@ along with this program. If not, see . static const COLORREF crCols[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; -int msn_httpGatewayInit(HANDLE hConn,NETLIBOPENCONNECTION *nloc,NETLIBHTTPREQUEST *nlhr); -int msn_httpGatewayBegin(HANDLE hConn,NETLIBOPENCONNECTION *nloc); -int msn_httpGatewayWrapSend(HANDLE hConn,PBYTE buf,int len,int flags); -PBYTE msn_httpGatewayUnwrapRecv(NETLIBHTTPREQUEST *nlhr,PBYTE buf,int len,int *outBufLen,void *(*NetlibRealloc)(void*,size_t)); +int msn_httpGatewayInit(HNETLIBCONN hConn, NETLIBOPENCONNECTION *nloc, NETLIBHTTPREQUEST *nlhr); +int msn_httpGatewayBegin(HNETLIBCONN hConn, NETLIBOPENCONNECTION *nloc); +int msn_httpGatewayWrapSend(HNETLIBCONN hConn, PBYTE buf, int len, int flags); +PBYTE msn_httpGatewayUnwrapRecv(NETLIBHTTPREQUEST *nlhr, PBYTE buf, int len, int *outBufLen, void *(*NetlibRealloc)(void*, size_t)); static int CompareLists(const MsnContact *p1, const MsnContact *p2) { @@ -541,7 +541,7 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg) if (nloc.flags & NLOCF_SSL) nlhr.flags |= NLHRF_SSL; - HANDLE nlc = Netlib_OpenConnection(m_hNetlibUser, &nloc); + HNETLIBCONN 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; diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index 5f75cb3ea1..e210889035 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -184,7 +184,7 @@ struct CMsnProto : public PROTO HANDLE msnSearchId; HNETLIBUSER hNetlibUserHttps; - HANDLE hHttpsConnection; + HNETLIBCONN hHttpsConnection; HANDLE hMSNNudge; HANDLE hPopupError, hPopupHotmail, hPopupNotify; diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp index c3888ba028..a7a65ec54e 100644 --- a/protocols/MSN/src/msn_threads.cpp +++ b/protocols/MSN/src/msn_threads.cpp @@ -50,7 +50,7 @@ void __cdecl CMsnProto::msn_keepAliveThread(void*) p2p_clearDormantSessions(); #endif if (hHttpsConnection && (clock() - mHttpsTS) > 60 * CLOCKS_PER_SEC) { - HANDLE hConn = hHttpsConnection; + HNETLIBCONN hConn = hHttpsConnection; hHttpsConnection = NULL; Netlib_Shutdown(hConn); } @@ -608,7 +608,7 @@ ThreadData::~ThreadData() mir_free(mData); } -void ThreadData::applyGatewayData(HANDLE hConn, bool isPoll) +void ThreadData::applyGatewayData(HNETLIBCONN hConn, bool isPoll) { char szHttpPostUrl[300]; getGatewayUrl(szHttpPostUrl, sizeof(szHttpPostUrl), isPoll); diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h index 2f5c777c6d..e0ea208c9c 100644 --- a/protocols/MSN/src/stdafx.h +++ b/protocols/MSN/src/stdafx.h @@ -568,12 +568,12 @@ struct ThreadData STRLIST mJoinedIdentContactsWLID; char* mInitialContactWLID; - TInfoType mType; // thread type - MsnThreadFunc mFunc; // thread entry point - char mServer[80]; // server name - char mState[128]; // state on XFR + TInfoType mType; // thread type + MsnThreadFunc mFunc; // thread entry point + char mServer[80]; // server name + char mState[128]; // state on XFR - HANDLE s; // NetLib connection for the thread + HNETLIBCONN s; // NetLib connection for the thread HANDLE mIncomingBoundPort; // Netlib listen for the thread HANDLE hWaitEvent; WORD mIncomingPort; @@ -608,7 +608,7 @@ struct ThreadData size_t mDataSize; //----| methods |--------------------------------------------------------------------- - void applyGatewayData(HANDLE hConn, bool isPoll); + void applyGatewayData(HNETLIBCONN hConn, bool isPoll); void getGatewayUrl(char* dest, int destlen, bool isPoll); void processSessionData(const char* xMsgr, const char* xHost); void startThread(MsnThreadFunc , CMsnProto *prt); -- cgit v1.2.3