Răsfoiți Sursa

fragment dispatching fix

eihrul 15 ani în urmă
părinte
comite
2d985dba91
4 a modificat fișierele cu 8 adăugiri și 3 ștergeri
  1. 1 1
      ChangeLog
  2. 2 0
      include/enet/enet.h
  3. 2 2
      peer.c
  4. 3 0
      protocol.c

+ 1 - 1
ChangeLog

@@ -1,4 +1,4 @@
-ENet 1.2.2 (May 20, 2010):
+ENet 1.2.2 (June 5, 2010):
 
 * checksum functionality is now enabled by setting a checksum callback
 inside ENetHost instead of being a configure script option

+ 2 - 0
include/enet/enet.h

@@ -500,6 +500,8 @@ extern void                  enet_peer_setup_outgoing_command (ENetPeer *, ENetO
 extern ENetOutgoingCommand * enet_peer_queue_outgoing_command (ENetPeer *, const ENetProtocol *, ENetPacket *, enet_uint32, enet_uint16);
 extern ENetIncomingCommand * enet_peer_queue_incoming_command (ENetPeer *, const ENetProtocol *, ENetPacket *, enet_uint32);
 extern ENetAcknowledgement * enet_peer_queue_acknowledgement (ENetPeer *, const ENetProtocol *, enet_uint16);
+extern void                  enet_peer_dispatch_incoming_unreliable_commands (ENetPeer *, ENetChannel *);
+extern void                  enet_peer_dispatch_incoming_reliable_commands (ENetPeer *, ENetChannel *);
 
 extern size_t enet_protocol_command_size (enet_uint8);
 

+ 2 - 2
peer.c

@@ -585,7 +585,7 @@ enet_peer_queue_outgoing_command (ENetPeer * peer, const ENetProtocol * command,
     return outgoingCommand;
 }
 
-static void
+void
 enet_peer_dispatch_incoming_unreliable_commands (ENetPeer * peer, ENetChannel * channel)
 {
     ENetListIterator currentCommand;
@@ -614,7 +614,7 @@ enet_peer_dispatch_incoming_unreliable_commands (ENetPeer * peer, ENetChannel *
     }
 }
 
-static void
+void
 enet_peer_dispatch_incoming_reliable_commands (ENetPeer * peer, ENetChannel * channel)
 {
     ENetListIterator currentCommand;

+ 3 - 0
protocol.c

@@ -589,6 +589,9 @@ enet_protocol_handle_send_fragment (ENetHost * host, ENetPeer * peer, const ENet
        memcpy (startCommand -> packet -> data + fragmentOffset,
                (enet_uint8 *) command + sizeof (ENetProtocolSendFragment),
                fragmentLength);
+
+        if (startCommand -> fragmentsRemaining <= 0)
+          enet_peer_dispatch_incoming_reliable_commands (peer, channel);
     }
 
     return 0;