Files
Alexandr Stelnykovych cc164c7df6 spn/ships: bound HTTP ship handshake and abort it on ctx done
After the TCP connect, launchHTTPShip wrote the upgrade request and read
the response without a deadline, ignoring ctx. With keep-alive disabled,
a peer that accepts the connection but never answers blocked the caller
forever. After a sleep/resume cycle this left the SPN client stuck in
establishHomeHub: the 5 minute timeout in connectToHomeHub had no effect,
and the UI kept showing "Connecting to SPN..." until a restart.

Bound the handshake by a deadline of 30s, or the ctx deadline if that is
earlier, and close the connection when ctx is done. Both are lifted once
the handshake succeeds, so the ship's connection is unaffected.

Also close the connection on all handshake error paths, which previously
leaked it.

The new test covers a peer that accepts but never responds, for both a
ctx deadline and a ctx cancel.
2026-10-21 14:34:40 +03:00
..
2024-08-09 18:15:48 +03:00
2025-08-07 02:04:38 +03:00
2025-08-07 02:04:38 +03:00
2025-08-07 02:04:38 +03:00
2024-08-09 18:15:48 +03:00
2024-08-09 18:15:48 +03:00
2025-08-07 02:04:38 +03:00
2024-08-09 18:15:48 +03:00
2024-08-28 11:50:45 +02:00