From 92d0d6d10b815700e72869e87da044ffafd1c9bb Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 12 Feb 2011 21:07:30 +0000 Subject: (svn r22067) -Fix: don't hold a mutex when sending packets and thus possibly closing the connection as that wants to acquire the mutex again --- src/network/network_server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index ffd295008..071903797 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -571,6 +571,8 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap() } } + if (this->savegame_mutex != NULL) this->savegame_mutex->EndCritical(); + /* Send all packets (forced) and check if we have send it all */ if (this->SendPackets() && this->IsPacketQueueEmpty()) { /* All are sent, increase the sent_packets */ @@ -579,8 +581,6 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap() /* Not everything is sent, decrease the sent_packets */ if (sent_packets > 1) sent_packets /= 2; } - - if (this->savegame_mutex != NULL) this->savegame_mutex->EndCritical(); } return NETWORK_RECV_STATUS_OKAY; } -- cgit v1.2.3-70-g09d2