summaryrefslogtreecommitdiff
path: root/src/modules/netlib/netlib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/netlib/netlib.cpp')
-rw-r--r--src/modules/netlib/netlib.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/modules/netlib/netlib.cpp b/src/modules/netlib/netlib.cpp
index 320876ff20..e6fe71ada1 100644
--- a/src/modules/netlib/netlib.cpp
+++ b/src/modules/netlib/netlib.cpp
@@ -279,7 +279,7 @@ INT_PTR NetlibCloseHandle(WPARAM wParam, LPARAM)
HttpGatewayRemovePacket(nlc, -1);
else {
if (nlc->s != INVALID_SOCKET)
- NetlibDoClose(nlc);
+ NetlibDoClose(nlc, nlc->termRequested);
if (nlc->s2 != INVALID_SOCKET) closesocket(nlc->s2);
nlc->s2 = INVALID_SOCKET;
}
@@ -389,18 +389,20 @@ INT_PTR NetlibShutdown(WPARAM wParam, LPARAM)
switch(GetNetlibHandleType((void*)wParam)) {
case NLH_CONNECTION:
{
- struct NetlibConnection* nlc = (struct NetlibConnection*)wParam;
- if (nlc->hSsl) si.shutdown(nlc->hSsl);
- if (nlc->s != INVALID_SOCKET) shutdown(nlc->s, 2);
- if (nlc->s2 != INVALID_SOCKET) shutdown(nlc->s2, 2);
- nlc->termRequested = true;
+ NetlibConnection *nlc = (NetlibConnection*)wParam;
+ if (!nlc->termRequested) {
+ if (nlc->hSsl) si.shutdown(nlc->hSsl);
+ if (nlc->s != INVALID_SOCKET) shutdown(nlc->s, 2);
+ if (nlc->s2 != INVALID_SOCKET) shutdown(nlc->s2, 2);
+ nlc->termRequested = true;
+ }
}
break;
+
case NLH_BOUNDPORT:
- {
- struct NetlibBoundPort* nlb = (struct NetlibBoundPort*)wParam;
- if (nlb->s != INVALID_SOCKET) shutdown(nlb->s, 2);
- }
+ struct NetlibBoundPort* nlb = (struct NetlibBoundPort*)wParam;
+ if (nlb->s != INVALID_SOCKET)
+ shutdown(nlb->s, 2);
break;
}
ReleaseMutex(hConnectionHeaderMutex);