From 2e93497d5b19b4fc46f84cb18267bce357e48747 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 16 Aug 2014 16:02:58 +0000 Subject: Tox: - added netlib logging - minor fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@10203 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_netlib.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 protocols/Tox/src/tox_netlib.cpp (limited to 'protocols/Tox/src/tox_netlib.cpp') diff --git a/protocols/Tox/src/tox_netlib.cpp b/protocols/Tox/src/tox_netlib.cpp new file mode 100644 index 0000000000..a2fea7a615 --- /dev/null +++ b/protocols/Tox/src/tox_netlib.cpp @@ -0,0 +1,22 @@ +#include "common.h" + +void CToxProto::InitNetlib() +{ + wchar_t name[128]; + mir_sntprintf(name, SIZEOF(name), TranslateT("%s connection"), m_tszUserName); + + NETLIBUSER nlu = {0}; + nlu.cbSize = sizeof(nlu); + nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; + nlu.ptszDescriptiveName = name; + nlu.szSettingsModule = m_szModuleName; + hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); + + debugLogA("Setting protocol/module name to '%s'", m_szModuleName); +} + +void CToxProto::UninitNetlib() +{ + Netlib_CloseHandle(hNetlibUser); + hNetlibUser = NULL; +} -- cgit v1.2.3