mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 14:29:05 -07:00
fix fragment length when checksums are used
This commit is contained in:
parent
6ad4a745fb
commit
7af1cd0de7
1 changed files with 2 additions and 0 deletions
2
peer.c
2
peer.c
|
@ -108,6 +108,8 @@ enet_peer_send (ENetPeer * peer, enet_uint8 channelID, ENetPacket * packet)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
fragmentLength = peer -> mtu - sizeof (ENetProtocolHeader) - sizeof (ENetProtocolSendFragment);
|
fragmentLength = peer -> mtu - sizeof (ENetProtocolHeader) - sizeof (ENetProtocolSendFragment);
|
||||||
|
if (peer -> host -> checksum != NULL)
|
||||||
|
fragmentLength -= sizeof(enet_uint32);
|
||||||
|
|
||||||
if (packet -> dataLength > fragmentLength)
|
if (packet -> dataLength > fragmentLength)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue