Repository navigation
Commit b798f83
committed
http1connection: Return after reading the response that follows a 1xx
The 1xx branch of _read_message recursed to read the real response but
did not return afterward, so the outer frame fell through and ran the
rest of the function a second time. With a single "100 Continue" the
delegate was finished twice and a second body was read; with three, the
delegate was finished four times and _read_body ran four times.
A 1xx response has no Content-Length and is not chunked, so each of
those extra _read_body calls landed in _read_body_until_close. That was
survivable only when the server closed the connection promptly. Against
a server that keeps the connection open, the outer frame is left
blocked on a read that will never be satisfied and read_response never
completes.
Return the recursive call's result directly. The recursive call owns the
delegate from that point, so need_delegate_close is cleared first to
keep the finally block from calling on_connection_close() on a delegate
that has already been finished.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JD7LUuFMdyPJB1Dwdq6fPg1 parent 2670ca8 commit b798f83
2 files changed
Lines changed: 42 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
269 | 277 | | |
270 | 278 | | |
271 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
36 | 69 | | |
37 | 70 | | |
38 | 71 | | |
| |||
0 commit comments