summaryrefslogtreecommitdiff
path: root/protocols/Tlen/src/tlen_p2p_old.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-13 00:01:59 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-13 00:01:59 +0300
commite145db68fb5b7d0682a4b2be0174cebfe47dd74e (patch)
treec8f9edc907876d236eb16bc8ca8b592accb9846f /protocols/Tlen/src/tlen_p2p_old.cpp
parent3cb3883908e3168e5f955be3143771721614307a (diff)
a bit less netlib services
Diffstat (limited to 'protocols/Tlen/src/tlen_p2p_old.cpp')
-rw-r--r--protocols/Tlen/src/tlen_p2p_old.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/protocols/Tlen/src/tlen_p2p_old.cpp b/protocols/Tlen/src/tlen_p2p_old.cpp
index a2265f6e8a..71eee92fc8 100644
--- a/protocols/Tlen/src/tlen_p2p_old.cpp
+++ b/protocols/Tlen/src/tlen_p2p_old.cpp
@@ -300,7 +300,7 @@ static HANDLE TlenP2PBindSocks4(SOCKSBIND * sb, TLEN_FILE_TRANSFER *ft)
NETLIBOPENCONNECTION nloc = { sizeof(nloc) };
nloc.szHost = sb->szHost;
nloc.wPort = sb->wPort;
- HANDLE s = (HANDLE) CallService(MS_NETLIB_OPENCONNECTION, (WPARAM) ft->proto->hFileNetlibUser, (LPARAM) &nloc);
+ HANDLE s = Netlib_OpenConnection(ft->proto->hFileNetlibUser, &nloc);
if (s == NULL) {
// TlenLog("Connection failed (%d), thread ended", WSAGetLastError());
return NULL;
@@ -352,7 +352,7 @@ static HANDLE TlenP2PBindSocks5(SOCKSBIND * sb, TLEN_FILE_TRANSFER *ft)
NETLIBOPENCONNECTION nloc = { sizeof(nloc) };
nloc.szHost = sb->szHost;
nloc.wPort = sb->wPort;
- HANDLE s = (HANDLE) CallService(MS_NETLIB_OPENCONNECTION, (WPARAM) ft->proto->hFileNetlibUser, (LPARAM) &nloc);
+ HANDLE s = Netlib_OpenConnection(ft->proto->hFileNetlibUser, &nloc);
if (s == NULL) {
ft->proto->debugLogA("Connection failed (%d), thread ended", WSAGetLastError());
return NULL;
@@ -443,7 +443,6 @@ static HANDLE TlenP2PBindSocks5(SOCKSBIND * sb, TLEN_FILE_TRANSFER *ft)
HANDLE TlenP2PListen(TLEN_FILE_TRANSFER *ft)
{
- NETLIBBIND nlb = {0};
HANDLE s = NULL;
int useProxy;
DBVARIANT dbv;
@@ -491,13 +490,15 @@ HANDLE TlenP2PListen(TLEN_FILE_TRANSFER *ft)
ft->wLocalPort = sb.wPort;
}
}
+
+ NETLIBBIND nlb = {};
if (useProxy<2) {
nlb.cbSize = sizeof(NETLIBBIND);
nlb.pfnNewConnectionV2 = ft->pfnNewConnectionV2;
nlb.wPort = 0; // Use user-specified incoming port ranges, if available
nlb.pExtra = proto;
ft->proto->debugLogA("Calling MS_NETLIB_BINDPORT");
- s = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM) ft->proto->m_hNetlibUser, (LPARAM) &nlb);
+ s = Netlib_BindPort(ft->proto->m_hNetlibUser, &nlb);
ft->proto->debugLogA("listening on %d",s);
}
if (useProxy == 0) {