aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoreihrul <eihrul>2010-12-23 21:05:37 +0000
committereihrul <eihrul>2010-12-23 21:05:37 +0000
commit7af1cd0de7668a5742cf9a057254b88a5006e601 (patch)
treec04ca6dbfaf239b9c9f583cd37a06f62859efd4f
parent6ad4a745fbd5f9c8adfc82da6de22a27ee9038d8 (diff)
downloadenet-7af1cd0de7668a5742cf9a057254b88a5006e601.tar.gz
enet-7af1cd0de7668a5742cf9a057254b88a5006e601.zip
fix fragment length when checksums are used
-rw-r--r--peer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/peer.c b/peer.c
index d778ce1..e1c117f 100644
--- a/peer.c
+++ b/peer.c
@@ -108,6 +108,8 @@ enet_peer_send (ENetPeer * peer, enet_uint8 channelID, ENetPacket * packet)
return -1;
fragmentLength = peer -> mtu - sizeof (ENetProtocolHeader) - sizeof (ENetProtocolSendFragment);
+ if (peer -> host -> checksum != NULL)
+ fragmentLength -= sizeof(enet_uint32);
if (packet -> dataLength > fragmentLength)
{