mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 06:25:59 -07:00
Fix MTU negotiation on server side
On connect the MTU sent by the client gets stored and sent back unchanged if within minimum and maximum of the protocol. Then on verify connect a test is done if the returned MTU is smaller than the current MTU and if so gets adjusted. So as long as the MTU is within boundaries only the client specified MTU is relevant. This patch adds a check for smaller MTU on server side. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
153e10f953
commit
4faa11a243
1 changed files with 2 additions and 1 deletions
|
@ -384,6 +384,7 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet
|
|||
if (mtu > ENET_PROTOCOL_MAXIMUM_MTU)
|
||||
mtu = ENET_PROTOCOL_MAXIMUM_MTU;
|
||||
|
||||
if (mtu < peer -> mtu)
|
||||
peer -> mtu = mtu;
|
||||
|
||||
if (host -> outgoingBandwidth == 0 &&
|
||||
|
|
Loading…
Reference in a new issue