From f6e67b1138146147c5f551dfc559794eb4b492d3 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 31 Jan 2024 23:31:04 -0600 Subject: [PATCH] Automatically disable QoS tagging on the server-side too for blackhole router scenarios Also bump the threshold for QoS disablement to 3 losses to avoid unnecessary fallbacks on the server side. --- protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol.c b/protocol.c index 0093f862..9475e2d3 100644 --- a/protocol.c +++ b/protocol.c @@ -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); }