From 773421e8ba17637d994088c393d406226b516a30 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 11 Oct 2013 14:01:25 +0000 Subject: - m_hNetlibUser moved to PROTO_INTERFACE; - unified protocol loggers git-svn-id: http://svn.miranda-ng.org/main/trunk@6435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tlen/src/tlen_ws.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'protocols/Tlen/src/tlen_ws.cpp') diff --git a/protocols/Tlen/src/tlen_ws.cpp b/protocols/Tlen/src/tlen_ws.cpp index 7c8449e3e5..7e31aedd37 100644 --- a/protocols/Tlen/src/tlen_ws.cpp +++ b/protocols/Tlen/src/tlen_ws.cpp @@ -35,7 +35,7 @@ BOOL TlenWsInit(TlenProtocol *proto) mir_sntprintf(name, SIZEOF(name), TranslateT("%s connection"), proto->m_tszUserName); nlu.ptszDescriptiveName = name; nlu.szSettingsModule = proto->m_szModuleName; - proto->hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu); + proto->m_hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu); nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_NOOPTIONS | NUF_TCHAR; mir_sntprintf(name, SIZEOF(name), TranslateT("%s SOCKS connection"), proto->m_tszUserName); @@ -45,14 +45,14 @@ BOOL TlenWsInit(TlenProtocol *proto) nlus.useProxy = 0; CallService(MS_NETLIB_SETUSERSETTINGS, (WPARAM) proto->hFileNetlibUser, (LPARAM) &nlus); - return (proto->hNetlibUser != NULL)?TRUE:FALSE; + return (proto->m_hNetlibUser != NULL)?TRUE:FALSE; } void TlenWsUninit(TlenProtocol *proto) { - if (proto->hNetlibUser != NULL) Netlib_CloseHandle(proto->hNetlibUser); + if (proto->m_hNetlibUser != NULL) Netlib_CloseHandle(proto->m_hNetlibUser); if (proto->hFileNetlibUser != NULL) Netlib_CloseHandle(proto->hFileNetlibUser); - proto->hNetlibUser = NULL; + proto->m_hNetlibUser = NULL; proto->hFileNetlibUser = NULL; } @@ -65,7 +65,7 @@ HANDLE TlenWsConnect(TlenProtocol *proto, char *host, WORD port) nloc.wPort = port; nloc.flags = 0; nloc.timeout = 6; - return (HANDLE) CallService(MS_NETLIB_OPENCONNECTION, (WPARAM) proto->hNetlibUser, (LPARAM) &nloc); + return (HANDLE) CallService(MS_NETLIB_OPENCONNECTION, (WPARAM) proto->m_hNetlibUser, (LPARAM) &nloc); } @@ -73,7 +73,7 @@ int TlenWsSend(TlenProtocol *proto, HANDLE s, char *data, int datalen) { int len; if ((len=Netlib_Send(s, data, datalen, /*MSG_NODUMP|*/MSG_DUMPASTEXT)) == SOCKET_ERROR || len != datalen) { - TlenLog(proto, "Netlib_Send() failed, error=%d", WSAGetLastError()); + proto->debugLogA("Netlib_Send() failed, error=%d", WSAGetLastError()); return FALSE; } return TRUE; @@ -84,11 +84,11 @@ int TlenWsRecv(TlenProtocol *proto, HANDLE s, char *data, long datalen) int ret; ret = Netlib_Recv(s, data, datalen, /*MSG_NODUMP|*/MSG_DUMPASTEXT); if (ret == SOCKET_ERROR) { - TlenLog(proto, "Netlib_Recv() failed, error=%d", WSAGetLastError()); + proto->debugLogA("Netlib_Recv() failed, error=%d", WSAGetLastError()); return 0; } if (ret == 0) { - TlenLog(proto, "Connection closed gracefully"); + proto->debugLogA("Connection closed gracefully"); return 0; } return ret; @@ -115,9 +115,9 @@ int TlenWsSendAES(TlenProtocol *proto, char *data, int datalen, aes_context *aes len += 16; } if (len > 0) { - TlenLog(proto, "Sending %d bytes", len); + proto->debugLogA("Sending %d bytes", len); if ((sendlen=Netlib_Send(proto->threadData->s, (char *)aes_output, len, MSG_NODUMP)) == SOCKET_ERROR || len != sendlen) { - TlenLog(proto, "Netlib_Send() failed, error=%d", WSAGetLastError()); + proto->debugLogA("Netlib_Send() failed, error=%d", WSAGetLastError()); return FALSE; } } @@ -136,11 +136,11 @@ int TlenWsRecvAES(TlenProtocol *proto, char *data, long datalen, aes_context *ae for (maxlen = maxlen & ~0xF; maxlen != 0; maxlen = maxlen & 0xF) { ret = Netlib_Recv(proto->threadData->s, data, maxlen, MSG_NODUMP); if (ret == SOCKET_ERROR) { - TlenLog(proto, "Netlib_Recv() failed, error=%d", WSAGetLastError()); + proto->debugLogA("Netlib_Recv() failed, error=%d", WSAGetLastError()); return 0; } if (ret == 0) { - TlenLog(proto, "Connection closed gracefully"); + proto->debugLogA("Connection closed gracefully"); return 0; } data += ret; -- cgit v1.2.3