shithub: choc

Download patch

ref: 5de10e5802a270e72423113e8b2613659c3dee30
parent: 536a4bf248ab5a034a9528cbb0fcf5f77f34c3eb
author: Simon Howard <fraggle@soulsphere.org>
date: Tue May 29 18:12:15 EDT 2018

net: Set keepalive_recv_time on connection setup.

If the keepalive last-receive time is not initialized when the
connection is established, there is a risk that the connection will
immediately time out. This was causing problems for some players
where clients were successfully connecting to servers only to find
themselves stuck in the pre-game "lobby" area with no information
about other players.

This fixes #1046. Thanks to @bradc6 for the bug report.

--- a/src/net_common.c
+++ b/src/net_common.c
@@ -59,6 +59,7 @@
     conn->reliable_packets = NULL;
     conn->reliable_send_seq = 0;
     conn->reliable_recv_seq = 0;
+    conn->keepalive_recv_time = I_GetTimeMS();
 }
 
 // Initialize as a client connection