mirror of
https://github.com/go-gost/x.git
synced 2026-10-20 00:17:32 +00:00
streamConn embeds the session's net.Conn and overrides Read/Write/Close, but not the deadline methods, so those reached the connection every stream shares. Any deadline set by one stream then outlived it and decided when the others could read. net/http makes this reachable: tearing down a connection parks a pending read with SetReadDeadline(time.Unix(1, 0)) and clears it only when a read was actually in flight. Without a read in flight the shared conn is left with a deadline in 1970, and the next Accept on the session fails immediately with an i/o timeout — reported as a listener error even though the session was healthy. Delegate the three deadline methods to the stream, which has always had its own. The test drives one request end to end over a stream, applies that teardown deadline, and asserts the session still hands out the next stream. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>