summaryrefslogtreecommitdiff
path: root/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'network.c')
-rw-r--r--network.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/network.c b/network.c
index 31b3b09aa..26fd3b1ce 100644
--- a/network.c
+++ b/network.c
@@ -482,7 +482,10 @@ void NetworkCloseClient(NetworkClientState *cs)
{
NetworkClientInfo *ci;
// Socket is already dead
- if (cs->socket == INVALID_SOCKET) return;
+ if (cs->socket == INVALID_SOCKET) {
+ cs->quited = true;
+ return;
+ }
DEBUG(net, 1) ("[NET] Closed client connection");
@@ -509,6 +512,7 @@ void NetworkCloseClient(NetworkClientState *cs)
closesocket(cs->socket);
cs->writable = false;
+ cs->quited = true;
// Free all pending and partially received packets
while (cs->packet_queue != NULL) {