aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2020-10-19 20:21:04 -0400
committerLee Salzman <[email protected]>2020-10-19 20:21:04 -0400
commit0d1fb32ee8e99c5fd06a5326dc1e5af4d8c98e23 (patch)
tree800c2db2ae4cf224c16636bb7edfd392e9d6b1f9
parent0bd265b230ae47787d2ef793402146ff56805e2b (diff)
downloadenet-0d1fb32ee8e99c5fd06a5326dc1e5af4d8c98e23.tar.gz
enet-0d1fb32ee8e99c5fd06a5326dc1e5af4d8c98e23.zip
fix for sending getting too far ahead of receiver
-rw-r--r--protocol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/protocol.c b/protocol.c
index 9dde122..da5d618 100644
--- a/protocol.c
+++ b/protocol.c
@@ -1411,8 +1411,8 @@ enet_protocol_check_outgoing_commands (ENetHost * host, ENetPeer * peer)
outgoingCommand -> sendAttempts < 1 &&
! (outgoingCommand -> reliableSequenceNumber % ENET_PEER_RELIABLE_WINDOW_SIZE) &&
(channel -> reliableWindows [(reliableWindow + ENET_PEER_RELIABLE_WINDOWS - 1) % ENET_PEER_RELIABLE_WINDOWS] >= ENET_PEER_RELIABLE_WINDOW_SIZE ||
- channel -> usedReliableWindows & ((((1 << ENET_PEER_FREE_RELIABLE_WINDOWS) - 1) << reliableWindow) |
- (((1 << ENET_PEER_FREE_RELIABLE_WINDOWS) - 1) >> (ENET_PEER_RELIABLE_WINDOWS - reliableWindow)))))
+ channel -> usedReliableWindows & ((((1 << (ENET_PEER_FREE_RELIABLE_WINDOWS + 1)) - 1) << reliableWindow) |
+ (((1 << (ENET_PEER_FREE_RELIABLE_WINDOWS + 1)) - 1) >> (ENET_PEER_RELIABLE_WINDOWS - reliableWindow)))))
windowWrap = 1;
if (windowWrap)
{