mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 14:29:05 -07:00
bug fixes
This commit is contained in:
parent
5055669683
commit
33974e01a2
2 changed files with 11 additions and 8 deletions
1
peer.c
1
peer.c
|
@ -558,6 +558,7 @@ enet_peer_queue_incoming_command (ENetPeer * peer, const ENetProtocol * command,
|
|||
|
||||
switch (command -> header.command)
|
||||
{
|
||||
case ENET_PROTOCOL_COMMAND_SEND_FRAGMENT:
|
||||
case ENET_PROTOCOL_COMMAND_SEND_RELIABLE:
|
||||
for (currentCommand = enet_list_previous (enet_list_end (& channel -> incomingReliableCommands));
|
||||
currentCommand != enet_list_end (& channel -> incomingReliableCommands);
|
||||
|
|
|
@ -396,10 +396,11 @@ enet_protocol_handle_send_fragment (ENetHost * host, ENetPeer * peer, const ENet
|
|||
fragmentCount != startCommand -> fragmentCount)
|
||||
return;
|
||||
|
||||
if ((startCommand -> fragments [fragmentNumber / 32] & (1 << fragmentNumber)) == 0)
|
||||
if ((startCommand -> fragments [fragmentNumber / 32] & (1 << (fragmentNumber & 32))) == 0)
|
||||
{
|
||||
-- startCommand -> fragmentsRemaining;
|
||||
|
||||
startCommand -> fragments [fragmentNumber / 32] |= (1 << fragmentNumber);
|
||||
startCommand -> fragments [fragmentNumber / 32] |= (1 << (fragmentNumber & 32));
|
||||
|
||||
if (fragmentOffset + fragmentLength > startCommand -> packet -> dataLength)
|
||||
fragmentLength = startCommand -> packet -> dataLength - fragmentOffset;
|
||||
|
@ -408,6 +409,7 @@ enet_protocol_handle_send_fragment (ENetHost * host, ENetPeer * peer, const ENet
|
|||
(enet_uint8 *) command + sizeof (ENetProtocolSendFragment),
|
||||
fragmentLength);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
enet_protocol_handle_ping (ENetHost * host, ENetPeer * peer, const ENetProtocol * command)
|
||||
|
|
Loading…
Reference in a new issue