diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-11 15:11:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-11 15:11:36 +0000 |
commit | 6aeafa47b02b966067d3ff83453c9ae8f9b0fc70 (patch) | |
tree | 30a31a165c2712d6af297cf4819fc5787f5344d7 /src/modules/netlib/netlibbind.cpp | |
parent | 1ba746b6a4c979841a3b3452347da0aa78964f95 (diff) |
only a few real mir_forkthreadex survived
git-svn-id: http://svn.miranda-ng.org/main/trunk@3977 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/netlib/netlibbind.cpp')
-rw-r--r-- | src/modules/netlib/netlibbind.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/modules/netlib/netlibbind.cpp b/src/modules/netlib/netlibbind.cpp index 01ed2b7413..9e1752cd33 100644 --- a/src/modules/netlib/netlibbind.cpp +++ b/src/modules/netlib/netlibbind.cpp @@ -113,13 +113,12 @@ int NetlibFreeBoundPort(struct NetlibBoundPort *nlbp) closesocket(nlbp->s);
closesocket(nlbp->s6);
WaitForSingleObject(nlbp->hThread, INFINITE);
- CloseHandle(nlbp->hThread);
NetlibLogf(nlbp->nlu, "(%u) Port %u closed for incoming connections", nlbp->s, nlbp->wPort);
mir_free(nlbp);
return 1;
}
-static unsigned __stdcall NetlibBindAcceptThread(void* param)
+static void NetlibBindAcceptThread(void* param)
{
SOCKET s;
SOCKADDR_INET_M sin;
@@ -169,7 +168,6 @@ static unsigned __stdcall NetlibBindAcceptThread(void* param) nlbp->pfnNewConnectionV2(nlc, ntohl(sin.Ipv4.sin_addr.S_un.S_addr), nlbp->pExtra);
}
NetlibUPnPDeletePortMapping(nlbp->wExPort, "TCP");
- return 0;
}
INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam)
@@ -180,7 +178,6 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) SOCKADDR_IN sin = {0};
SOCKADDR_IN6 sin6 = {0};
int foundPort = 0;
- UINT dwThreadId;
if (GetNetlibHandleType(nlu) != NLH_USER || !(nlu->user.flags & NUF_INCOMING) ||
nlb == NULL || nlb->pfnNewConnection == NULL)
@@ -319,14 +316,13 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) NetlibLogf(NULL, "UPnP disabled. Internal Port: %u\n", nlb->wPort);
nlbp->wExPort = 0;
- if (nlb->cbSize > NETLIBBIND_SIZEOF_V2)
- {
+ if (nlb->cbSize > NETLIBBIND_SIZEOF_V2) {
nlb->wExPort = nlb->wPort;
nlb->dwExternalIP = nlb->dwInternalIP;
}
}
}
- nlbp->hThread = (HANDLE)mir_forkthreadex(NetlibBindAcceptThread, nlbp, &dwThreadId);
+ nlbp->hThread = mir_forkthread(NetlibBindAcceptThread, nlbp);
return (INT_PTR)nlbp;
}
|