aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2023-04-01 14:49:22 -0400
committerLee Salzman <[email protected]>2023-04-01 14:49:22 -0400
commit8ae0e85298fafdb20777b4eb4241218f52f775b0 (patch)
tree607a8e171f9d085ccfbf88f9a80022ccb64bba99
parent07a40ef0f9e5355d422f271da9a115219d0e9308 (diff)
downloadenet-8ae0e85298fafdb20777b4eb4241218f52f775b0.tar.gz
enet-8ae0e85298fafdb20777b4eb4241218f52f775b0.zip
update connecting peer's mtu from host's current mtu
-rw-r--r--host.c1
-rw-r--r--protocol.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/host.c b/host.c
index 54bd4c9..fff946a 100644
--- a/host.c
+++ b/host.c
@@ -211,6 +211,7 @@ enet_host_connect (ENetHost * host, const ENetAddress * address, size_t channelC
currentPeer -> state = ENET_PEER_STATE_CONNECTING;
currentPeer -> address = * address;
currentPeer -> connectID = enet_host_random (host);
+ currentPeer -> mtu = host -> mtu;
if (host -> outgoingBandwidth == 0)
currentPeer -> windowSize = ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE;
diff --git a/protocol.c b/protocol.c
index e38be63..b7af48d 100644
--- a/protocol.c
+++ b/protocol.c
@@ -340,6 +340,7 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet
peer -> state = ENET_PEER_STATE_ACKNOWLEDGING_CONNECT;
peer -> connectID = command -> connect.connectID;
peer -> address = host -> receivedAddress;
+ peer -> mtu = host -> mtu;
peer -> outgoingPeerID = ENET_NET_TO_HOST_16 (command -> connect.outgoingPeerID);
peer -> incomingBandwidth = ENET_NET_TO_HOST_32 (command -> connect.incomingBandwidth);
peer -> outgoingBandwidth = ENET_NET_TO_HOST_32 (command -> connect.outgoingBandwidth);