fix excessive retransmissions when average RTT variance is 0

This commit is contained in:
Cameron Gutman
2021-05-16 15:35:02 -05:00
parent ab9d471cec
commit ad5bf95397
+1 -1
View File
@@ -1466,7 +1466,7 @@ enet_protocol_check_outgoing_commands (ENetHost * host, ENetPeer * peer)
if (outgoingCommand -> roundTripTimeout == 0)
{
outgoingCommand -> roundTripTimeout = peer -> roundTripTime + 4 * peer -> roundTripTimeVariance;
outgoingCommand -> roundTripTimeout = peer -> roundTripTime + 4 * ENET_MAX (1, peer -> roundTripTimeVariance);
outgoingCommand -> roundTripTimeoutLimit = peer -> timeoutLimit * outgoingCommand -> roundTripTimeout;
}