You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Idle keep-alive connection sometimes held until HTTPS_CONNECTION_TIMEOUT after the client closed it #9
On an ESP32-C3 (iotsa, cwi-dis/iotsa#293), after a request with Connection: keep-alive and a buffered response, the client (Python requests) closes the connection, but the server sometimes doesn't notice: [HTTPS:I] Connection timeout. FID=51 only after HTTPS_CONNECTION_TIMEOUT (20 s). In another run the same client's close was seen immediately (Client closed connection).
While the connection is held, its TLS session (~45 KB on the C3) stays allocated, and a new connection fails in mbedtls_ssl_setup with -0x7F00 (alloc failed).
iotsa works around it by answering with Connection: close (cwi-dis/iotsa#293). This issue is for the cause: why a closed client socket isn't always detected while the connection waits in STATE_INITIAL for the next keep-alive request.
Related design for this server, from cwi-dis/iotsa#293 (cwi-dis/iotsa#293 (comment)): when a new connection comes in, first close all completely idle keep-alive connections (STATE_INITIAL, nothing buffered, not a WebSocket), as a switchable policy, on by default. That frees their TLS sessions before the new one is set up. This issue (the missed close) stays open alongside it.
Activity
jackjansen commentedon Oct 18, 2026
Related design for this server, from cwi-dis/iotsa#293 (cwi-dis/iotsa#293 (comment)): when a new connection comes in, first close all completely idle keep-alive connections (STATE_INITIAL, nothing buffered, not a WebSocket), as a switchable policy, on by default. That frees their TLS sessions before the new one is set up. This issue (the missed close) stays open alongside it.
— Claude Code (Claude Opus 5.5)
Answer Connection: close on the compat web server (#293)