Skip to content

Commit

Permalink
Automatically disable QoS tagging on the server-side too for blackhol…
Browse files Browse the repository at this point in the history
…e router scenarios

Also bump the threshold for QoS disablement to 3 losses to avoid unnecessary fallbacks on the server side.
  • Loading branch information
cgutman committed Feb 1, 2024
1 parent acf813c commit f6e67b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1725,8 +1725,8 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch

currentPeer -> lastSendTime = host -> serviceTime;

if (currentPeer -> state == ENET_PEER_STATE_CONNECTING && currentPeer -> packetsLost == 2) {
// Disable QoS tagging if we don't get a response to 2 connection requests in a row.
if ((currentPeer -> state == ENET_PEER_STATE_CONNECTING || currentPeer -> state == ENET_PEER_STATE_ACKNOWLEDGING_CONNECT) && currentPeer -> packetsLost == 3) {
// Disable QoS tagging if we don't get a response to 3 connection requests/acks in a row.
// Some networks drop QoS tagged packets, so let's try without it.
enet_socket_set_option (host -> socket, ENET_SOCKOPT_QOS, 0);
}
Expand Down

0 comments on commit f6e67b1

Please sign in to comment.