aboutsummaryrefslogtreecommitdiffhomepage
path: root/peer.c
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2020-07-23 04:42:59 -0400
committerLee Salzman <[email protected]>2020-07-23 04:42:59 -0400
commit47d2e192aa6a0294eaed69a95a7755c890759106 (patch)
tree6ecabbb88febc680677a1758b09243fc1095b0a2 /peer.c
parent224f31101fc60939c02f6bbe8e8fc810a7db306b (diff)
downloadenet-47d2e192aa6a0294eaed69a95a7755c890759106.tar.gz
enet-47d2e192aa6a0294eaed69a95a7755c890759106.zip
use unified outgoing command queue for reliable and unreliable commands
Diffstat (limited to 'peer.c')
-rw-r--r--peer.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/peer.c b/peer.c
index 1278b85..ca93289 100644
--- a/peer.c
+++ b/peer.c
@@ -318,8 +318,7 @@ enet_peer_reset_queues (ENetPeer * peer)
enet_peer_reset_outgoing_commands (& peer -> sentReliableCommands);
enet_peer_reset_outgoing_commands (& peer -> sentUnreliableCommands);
- enet_peer_reset_outgoing_commands (& peer -> outgoingReliableCommands);
- enet_peer_reset_outgoing_commands (& peer -> outgoingUnreliableCommands);
+ enet_peer_reset_outgoing_commands (& peer -> outgoingCommands);
enet_peer_reset_incoming_commands (& peer -> dispatchedCommands);
if (peer -> channels != NULL && peer -> channelCount > 0)
@@ -573,8 +572,7 @@ void
enet_peer_disconnect_later (ENetPeer * peer, enet_uint32 data)
{
if ((peer -> state == ENET_PEER_STATE_CONNECTED || peer -> state == ENET_PEER_STATE_DISCONNECT_LATER) &&
- ! (enet_list_empty (& peer -> outgoingReliableCommands) &&
- enet_list_empty (& peer -> outgoingUnreliableCommands) &&
+ ! (enet_list_empty (& peer -> outgoingCommands) &&
enet_list_empty (& peer -> sentReliableCommands)))
{
peer -> state = ENET_PEER_STATE_DISCONNECT_LATER;
@@ -676,10 +674,7 @@ enet_peer_setup_outgoing_command (ENetPeer * peer, ENetOutgoingCommand * outgoin
break;
}
- if (outgoingCommand -> command.header.command & ENET_PROTOCOL_COMMAND_FLAG_ACKNOWLEDGE)
- enet_list_insert (enet_list_end (& peer -> outgoingReliableCommands), outgoingCommand);
- else
- enet_list_insert (enet_list_end (& peer -> outgoingUnreliableCommands), outgoingCommand);
+ enet_list_insert (enet_list_end (& peer -> outgoingCommands), outgoingCommand);
}
ENetOutgoingCommand *