Commit 0db4361
Align _socket_looks_dead docstring with implementation
The function returns True when _protocol is missing or None, but the
old docstring claimed missing attributes default to False ("assume
alive"). The implementation is the right contract — a connection
without a protocol cannot pass any peer-FIN peek, so treating it as
dead avoids handing zombie connections out — but the docstring was
backwards and would have led future maintainers to debug a
non-existent bug.
Rewrite to enumerate the four positive dead-signals (no protocol,
!is_wire_coherent, transport.is_closing, reader.at_eof) and clarify
that mock-tolerance applies only to the transport peek arms.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d82041b commit 0db4361
1 file changed
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
73 | 91 | | |
74 | 92 | | |
75 | 93 | | |
| |||
0 commit comments