瀏覽代碼

Merge pull request #222 from seragh/server-mtu

Fix MTU negotiation on server side
Lee Salzman 2 年之前
父節點
當前提交
eb89a34d66
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      protocol.c

+ 2 - 1
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)