summaryrefslogtreecommitdiff
path: root/protocols/MSN
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-11 19:51:30 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-11 19:51:30 +0300
commitbb03623fd3ba7b9cc456da2c9504bad87b80ace0 (patch)
treea48d6ead0275d8b8e34815e20c22c64dcb30538a /protocols/MSN
parente004a33b7853108b49f77ced20a460b3c8b78c35 (diff)
- 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
Diffstat (limited to 'protocols/MSN')
-rw-r--r--protocols/MSN/src/msn_http.cpp5
-rw-r--r--protocols/MSN/src/msn_proto.cpp2
-rw-r--r--protocols/MSN/src/msn_ws.cpp8
3 files changed, 5 insertions, 10 deletions
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 <http://www.gnu.org/licenses/>.
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;