summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-02-12 21:07:30 +0000
committerrubidium <rubidium@openttd.org>2011-02-12 21:07:30 +0000
commit92d0d6d10b815700e72869e87da044ffafd1c9bb (patch)
tree9605fa72b3d0239fe0a6c1031742ff3d00ee94e4 /src/network
parentece59dc0d1cd21a4e55322ee31439f7f4baec72d (diff)
downloadopenttd-92d0d6d10b815700e72869e87da044ffafd1c9bb.tar.xz
(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
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_server.cpp4
1 files 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;
}