aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2023-03-10 14:01:19 -0500
committerGitHub <[email protected]>2023-03-10 14:01:19 -0500
commiteb89a34d66ac56256de2ad27e686e85c88d04c0f (patch)
tree3a69b774bb04e070a8b5d9c0085e70aebf65f44a
parent153e10f953d949eebf262e90b72d56b2e1928ff7 (diff)
parent4faa11a243d004d8a15d5353c693dbb487ddb613 (diff)
downloadenet-eb89a34d66ac56256de2ad27e686e85c88d04c0f.tar.gz
enet-eb89a34d66ac56256de2ad27e686e85c88d04c0f.zip
Merge pull request #222 from seragh/server-mtu
Fix MTU negotiation on server side
-rw-r--r--protocol.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/protocol.c b/protocol.c
index 9fc6adf..e38be63 100644
--- a/protocol.c
+++ b/protocol.c
@@ -384,7 +384,8 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet
if (mtu > ENET_PROTOCOL_MAXIMUM_MTU)
mtu = ENET_PROTOCOL_MAXIMUM_MTU;
- peer -> mtu = mtu;
+ if (mtu < peer -> mtu)
+ peer -> mtu = mtu;
if (host -> outgoingBandwidth == 0 &&
peer -> incomingBandwidth == 0)