From 7af1cd0de7668a5742cf9a057254b88a5006e601 Mon Sep 17 00:00:00 2001 From: eihrul Date: Thu, 23 Dec 2010 21:05:37 +0000 Subject: [PATCH] fix fragment length when checksums are used --- peer.c | 2 ++ 1 file changed, 2 insertions(+) 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) {