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/WhatsApp/src/WASocketConnection.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'protocols/WhatsApp/src/WASocketConnection.cpp') diff --git a/protocols/WhatsApp/src/WASocketConnection.cpp b/protocols/WhatsApp/src/WASocketConnection.cpp index b6ec0c0998..03ebf84ea7 100644 --- a/protocols/WhatsApp/src/WASocketConnection.cpp +++ b/protocols/WhatsApp/src/WASocketConnection.cpp @@ -30,12 +30,7 @@ void WASocketConnection::write(int i) char buffer; buffer = (char)i; - NETLIBBUFFER nlb; - nlb.buf = &buffer; - nlb.len = 1; - nlb.flags = MSG_NOHTTPGATEWAYWRAP | MSG_NODUMP; - - int result = CallService(MS_NETLIB_SEND, WPARAM(this->hConn), LPARAM(&nlb)); + int result = Netlib_Send(this->hConn, &buffer, 1, MSG_NOHTTPGATEWAYWRAP | MSG_NODUMP); if (result < 1) throw WAException(getLastErrorMsg(), WAException::SOCKET_EX, WAException::SOCKET_EX_SEND); } @@ -49,13 +44,8 @@ void WASocketConnection::flush() {} void WASocketConnection::write(const std::vector &bytes, int length) { - NETLIBBUFFER nlb; std::string tmpBuf = std::string(bytes.begin(), bytes.end()); - nlb.buf = (char*)&(tmpBuf.c_str()[0]); - nlb.len = length; - nlb.flags = MSG_NODUMP; - - int result = CallService(MS_NETLIB_SEND, WPARAM(hConn), LPARAM(&nlb)); + int result = Netlib_Send(hConn, tmpBuf.c_str(), length, MSG_NODUMP); if (result < length) throw WAException(getLastErrorMsg(), WAException::SOCKET_EX, WAException::SOCKET_EX_SEND); } -- cgit v1.2.3