Skip to content

Fix connections not timing out if clients haven't joined yet

Hanicef requested to merge Hanicef/SRB2:close-connection-timeout into next

If a client closes the connection or times out while a file is being transmitted over in-game download, the node was never closed properly. I'm not sure how this has never been a problem before, but the cause was due to the timeout system not closing connections if the player wasn't in-game. As a result, the server would keep sending packets to the client, even if the client has closed the connection.

My guess as to why this suddenly became a problem is that ever since !2232 (merged) was merged, servers has had the ability to run long enough to be able to run into this bug, since any server with significant activity was very likely to crash before due to that bug. As a result, it would never reach enough idle connections to trigger the freeze, since it would crash before it reached the limit.

This is how it behaves now:

img

A bit misleading that it shows "Ending file transfer for node 1" when it aborts the connection, but it does work as shown above.

Fixes #1404

Fixes #1395 (closed)

Merge request reports

Loading