mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-19 13:41:11 +00:00
(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
This commit is contained in:
parent
ece59dc0d1
commit
92d0d6d10b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user