From 20a9f536e44c3928ad8c3cf7a2959bce557dab8e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 13 Jan 2017 17:47:33 +0300 Subject: (wiping blood from hands) no more netlib services --- plugins/HTTPServer/src/FileShareNode.cpp | 2 +- plugins/Ping/src/utils.cpp | 2 +- plugins/YAMN/src/proto/netlib.cpp | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/HTTPServer/src/FileShareNode.cpp b/plugins/HTTPServer/src/FileShareNode.cpp index 8584df5111..fbc2d43af6 100644 --- a/plugins/HTTPServer/src/FileShareNode.cpp +++ b/plugins/HTTPServer/src/FileShareNode.cpp @@ -83,7 +83,7 @@ CLShareUser::~CLShareUser() void CLShareUser::CloseSocket() { - SOCKET s = CallService(MS_NETLIB_GETSOCKET, (WPARAM)hConnection, 0); + SOCKET s = Netlib_GetSocket(hConnection); if (s != INVALID_SOCKET) { shutdown(s, SD_SEND); int nBytesRead; diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 949c8cd1ee..e643b2423a 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -101,7 +101,7 @@ INT_PTR PluginPing(WPARAM, LPARAM lParam) if (s) { LINGER l; char buf[1024]; - SOCKET socket = (SOCKET)CallService(MS_NETLIB_GETSOCKET, (WPARAM)s, (LPARAM)NLOCF_HTTP); + SOCKET socket = Netlib_GetSocket(s); l.l_onoff = 1; l.l_linger = 0; setsockopt(socket, SOL_SOCKET, SO_LINGER, (char *)&l, sizeof(l)); diff --git a/plugins/YAMN/src/proto/netlib.cpp b/plugins/YAMN/src/proto/netlib.cpp index b6405b7e90..64da34ed8d 100644 --- a/plugins/YAMN/src/proto/netlib.cpp +++ b/plugins/YAMN/src/proto/netlib.cpp @@ -62,12 +62,12 @@ void CNLClient::SSLify() throw(DWORD) #ifdef DEBUG_COMM SSL_DebugLog("Staring SSL..."); #endif - int socket = CallService(MS_NETLIB_GETSOCKET, (WPARAM)hConnection, 0); + int socket = Netlib_GetSocket(hConnection); if (socket != INVALID_SOCKET) { #ifdef DEBUG_COMM SSL_DebugLog("Staring netlib core SSL"); #endif - if (CallService(MS_NETLIB_STARTSSL, (WPARAM)hConnection, 0)) { + if (Netlib_StartSsl(hConnection, NULL)) { #ifdef DEBUG_COMM SSL_DebugLog("Netlib core SSL started"); #endif @@ -180,12 +180,10 @@ char* CNLClient::Recv(char *buf, int buflen) throw(DWORD) throw NetworkError = (DWORD)ENL_RECVALLOC; if (!isTLSed) { - NETLIBSELECT nls; - memset(&nls, 0, sizeof(NETLIBSELECT)); - nls.cbSize = sizeof(NETLIBSELECT); + NETLIBSELECT nls = {}; nls.dwTimeout = 60000; nls.hReadConns[0] = hConnection; - switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls)) { + switch (Netlib_Select(&nls)) { case SOCKET_ERROR: free(buf); SystemError = WSAGetLastError(); -- cgit v1.2.3