mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #12658 from ZehMatt/fix-network-hang
Fix freezes on incomplete packet transmission
This commit is contained in:
commit
c1076658fc
|
@ -1721,8 +1721,10 @@ bool NetworkBase::ProcessConnection(NetworkConnection& connection)
|
|||
// could not read anything from socket
|
||||
break;
|
||||
}
|
||||
} while (packetStatus == NETWORK_READPACKET_MORE_DATA || packetStatus == NETWORK_READPACKET_SUCCESS);
|
||||
} while (packetStatus == NETWORK_READPACKET_SUCCESS);
|
||||
|
||||
connection.SendQueuedPackets();
|
||||
|
||||
if (!connection.ReceivedPacketRecently())
|
||||
{
|
||||
if (!connection.GetLastDisconnectReason())
|
||||
|
@ -1731,6 +1733,7 @@ bool NetworkBase::ProcessConnection(NetworkConnection& connection)
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# include "network.h"
|
||||
|
||||
constexpr size_t NETWORK_DISCONNECT_REASON_BUFFER_SIZE = 256;
|
||||
constexpr size_t NetworkBufferSize = 1024;
|
||||
constexpr size_t NetworkBufferSize = 1024 * 64; // 64 KiB, maximum packet size.
|
||||
|
||||
NetworkConnection::NetworkConnection()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue