fix race condition in packet queueing

This commit is contained in:
Lion Kortlepel
2021-03-30 15:13:32 +02:00
parent eaa6b5322f
commit e4d6c86919
2 changed files with 3 additions and 1 deletions

View File

@@ -338,6 +338,7 @@ std::shared_ptr<TClient> TNetwork::CreateClient(SOCKET TCPSock) {
bool TNetwork::TCPSend(TClient& c, const std::string& Data, bool IsSync) {
if (!IsSync) {
std::unique_lock Lock(c.MissedPacketQueueMutex());
if (c.IsSyncing()) {
c.EnqueueMissedPacketDuringSyncing(Data);
return true;