From bb03623fd3ba7b9cc456da2c9504bad87b80ace0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 11 Jan 2017 19:51:30 +0300 Subject: - Netlib_Send & Netlib_Recv helpers became real functions, MS_NETLIB_SEND & MS_NETLIB_RECV died; - fix for dumping chunked http replies into a network log --- protocols/MSN/src/msn_http.cpp | 5 ++--- protocols/MSN/src/msn_proto.cpp | 2 +- protocols/MSN/src/msn_ws.cpp | 8 ++------ 3 files changed, 5 insertions(+), 10 deletions(-) (limited to 'protocols/MSN/src') diff --git a/protocols/MSN/src/msn_http.cpp b/protocols/MSN/src/msn_http.cpp index 7ea45b5a8a..74a0f66fb7 100644 --- a/protocols/MSN/src/msn_http.cpp +++ b/protocols/MSN/src/msn_http.cpp @@ -52,7 +52,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, MIRANDASERVICE pfnNetlibSend) +int msn_httpGatewayWrapSend(HANDLE hConn, PBYTE buf, int len, int flags) { ThreadData *T = FindThreadConn(hConn); if (T != NULL) { @@ -62,8 +62,7 @@ int msn_httpGatewayWrapSend(HANDLE hConn, PBYTE buf, int len, int flags, MIRANDA T->applyGatewayData(hConn, len == 0); } - NETLIBBUFFER tBuf = { (char*)buf, len, flags }; - return pfnNetlibSend((LPARAM)hConn, WPARAM(&tBuf)); + return Netlib_Send(hConn, (char*)buf, len, flags); } //======================================================================================= diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index ce4d563de3..1efe0b33d9 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -25,7 +25,7 @@ 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,MIRANDASERVICE pfnNetlibSend); +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)); static int CompareLists(const MsnContact *p1, const MsnContact *p2) diff --git a/protocols/MSN/src/msn_ws.cpp b/protocols/MSN/src/msn_ws.cpp index d087f579c0..1c7dcd07e9 100644 --- a/protocols/MSN/src/msn_ws.cpp +++ b/protocols/MSN/src/msn_ws.cpp @@ -27,8 +27,6 @@ along with this program. If not, see . int ThreadData::send(const char data[], size_t datalen) { - NETLIBBUFFER nlb = { (char*)data, (int)datalen, 0 }; - resetTimeout(); if (proto->usingGateway && !(mType == SERVER_FILETRANS || mType == SERVER_P2P_DIRECT)) { @@ -36,7 +34,7 @@ int ThreadData::send(const char data[], size_t datalen) CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(s), mGatewayTimeout); } - int rlen = CallService(MS_NETLIB_SEND, (WPARAM)s, (LPARAM)&nlb); + int rlen = Netlib_Send(s, data, (int)datalen); if (rlen == SOCKET_ERROR) { // should really also check if sendlen is the same as datalen proto->debugLogA("Send failed: %d", WSAGetLastError()); @@ -113,8 +111,6 @@ bool ThreadData::isTimeout(void) int ThreadData::recv(char* data, size_t datalen) { - NETLIBBUFFER nlb = { data, (int)datalen, 0 }; - if (!proto->usingGateway) { resetTimeout(); NETLIBSELECT nls = { 0 }; @@ -137,7 +133,7 @@ int ThreadData::recv(char* data, size_t datalen) } LBL_RecvAgain: - int ret = CallService(MS_NETLIB_RECV, (WPARAM)s, (LPARAM)&nlb); + int ret = Netlib_Recv(s, data, (int)datalen); if (ret == 0) { proto->debugLogA("Connection closed gracefully"); return 0; -- cgit v1.2.3