Changeset - r25264:1089b783d3e8
[Not reviewed]
master
0 1 0
rubidium42 - 3 years ago 2021-04-25 15:53:24
rubidium@openttd.org
Fix: [Network] Prevent stalling save game transfer when compression is slow
1 file changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/network/network_server.cpp
Show inline comments
 
@@ -592,7 +592,7 @@ void ServerNetworkGameSocketHandler::Che
 
/** This sends the map to the client */
 
NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap()
 
{
 
	static uint sent_packets; // How many packets we did send successfully last time
 
	static uint16 sent_packets; // How many packets we did send successfully last time
 

	
 
	if (this->status < STATUS_AUTHORIZED) {
 
		/* Illegal call, return error and ignore the packet */
 
@@ -652,8 +652,10 @@ NetworkRecvStatus ServerNetworkGameSocke
 
				return NETWORK_RECV_STATUS_CONN_LOST;
 

	
 
			case SPS_ALL_SENT:
 
				/* All are sent, increase the sent_packets */
 
				if (has_packets) sent_packets *= 2;
 
				/* All are sent, increase the sent_packets but do not overflow! */
 
				if (has_packets && sent_packets < std::numeric_limits<decltype(sent_packets)>::max() / 2) {
 
					sent_packets *= 2;
 
				}
 
				break;
 

	
 
			case SPS_PARTLY_SENT:
0 comments (0 inline, 0 general)