From 9bf55a343314917ba9de5be192f2aad77697193c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 12 Jun 2020 21:16:46 -0700 Subject: [PATCH] Disable QoS tagging if 2 connect packets in a row are dropped --- protocol.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/protocol.c b/protocol.c index d268214..4d95519 100644 --- a/protocol.c +++ b/protocol.c @@ -1718,6 +1718,12 @@ 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. + // Some networks drop QoS tagged packets, so let's try without it. + enet_socket_set_option (host -> socket, ENET_SOCKOPT_QOS, 0); + } + sentLength = enet_socket_send (host -> socket, & currentPeer -> address, host -> buffers, host -> bufferCount); enet_protocol_remove_sent_unreliable_commands (currentPeer);