foxygit / doom Log in
commit 5de10e5802a270e72423113e8b2613659c3dee30
Author:     Simon Howard <fraggle@soulsphere.org>
AuthorDate: Tue May 29 22:12:15 2018 -0400
Commit:     Simon Howard <fraggle@soulsphere.org>
CommitDate: Tue May 29 22:12:15 2018 -0400

    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.
---
 src/net_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/net_common.c b/src/net_common.c
index 984eb435..deadcded 100644
--- a/src/net_common.c
+++ b/src/net_common.c
@@ -59,6 +59,7 @@ static void NET_Conn_Init(net_connection_t *conn, net_addr_t *addr,
     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