mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-05 16:02:32 +00:00
Every accepted inbound socket was given SO_LINGER = 0, so closing it sent a reset. That discards whatever is still queued for the peer: a response whose end is marked by the close itself -- HTTP/1.0, a body with no length, anything read to EOF -- can be truncated, and a peer that has received every byte but not yet read them can still see the transfer fail with a reset. What it bought was the socket back at once, with no TIME_WAIT. But TIME_WAIT falls on whoever closes first, and on the common paths that is the client: leaf is the passive closer and has no TIME_WAIT to avoid. The reclaim is only ever paid for on the paths where leaf closes first -- the idle timeouts and the error teardowns -- and those are the paths where a reset is the right answer anyway. So it is now off by default and available as TCP_INBOUND_ABORT_ON_CLOSE, for devices that cannot afford the sockets. Sessions are still bounded by the existing uplink and downlink idle timeouts.