mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 06:25:59 -07:00
handle case in bandwidth limit protocol where either incoming or outgoing limits are disabled, but not both
This commit is contained in:
parent
8df6e58c5f
commit
9b06a12e71
1 changed files with 4 additions and 0 deletions
|
@ -764,6 +764,10 @@ enet_protocol_handle_bandwidth_limit (ENetHost * host, ENetPeer * peer, const EN
|
|||
|
||||
if (peer -> incomingBandwidth == 0 && host -> outgoingBandwidth == 0)
|
||||
peer -> windowSize = ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE;
|
||||
else
|
||||
if (peer -> incomingBandwidth == 0 || host -> outgoingBandwidth == 0)
|
||||
peer -> windowSize = (ENET_MAX (peer -> incomingBandwidth, host -> outgoingBandwidth) /
|
||||
ENET_PEER_WINDOW_SIZE_SCALE) * ENET_PROTOCOL_MINIMUM_WINDOW_SIZE;
|
||||
else
|
||||
peer -> windowSize = (ENET_MIN (peer -> incomingBandwidth, host -> outgoingBandwidth) /
|
||||
ENET_PEER_WINDOW_SIZE_SCALE) * ENET_PROTOCOL_MINIMUM_WINDOW_SIZE;
|
||||
|
|
Loading…
Reference in a new issue