summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoreihrul <eihrul>2010-06-05 20:31:31 +0000
committereihrul <eihrul>2010-06-05 20:31:31 +0000
commit2d985dba913f815302b8fb86c9ff0956f3c2f1a3 (patch)
treed156a1972b119b37e34273c03f2bd268c1c25341
parent4c8544636be6c928e6675529c46d3c1d1d248f7d (diff)
downloadenet-2d985dba913f815302b8fb86c9ff0956f3c2f1a3.tar.gz
enet-2d985dba913f815302b8fb86c9ff0956f3c2f1a3.zip
fragment dispatching fix
-rw-r--r--ChangeLog2
-rw-r--r--include/enet/enet.h2
-rw-r--r--peer.c4
-rw-r--r--protocol.c3
4 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e274eda..8514f23 100644
--- a/ChangeLog
+++ b/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
diff --git a/include/enet/enet.h b/include/enet/enet.h
index 2aa61f1..17a34e7 100644
--- a/include/enet/enet.h
+++ b/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);
diff --git a/peer.c b/peer.c
index 395a902..1c616fa 100644
--- a/peer.c
+++ b/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;
diff --git a/protocol.c b/protocol.c
index 4150a2a..df7dd7b 100644
--- a/protocol.c
+++ b/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;