Commit 3a8c195
fix: prevent postprocessor/errorHandler from overriding HTTP_STATUS_UNFINISHED (#828)
* Initial plan
* fix: prevent postprocessor/errorHandler from overriding HTTP_STATUS_UNFINISHED
When a handler returns HTTP_STATUS_UNFINISHED (e.g., sendLargeFile), the
postprocessor's return value was overwriting status_code, causing the
connection to be treated as complete. This resulted in a premature empty
response being sent and the connection being reset/closed.
The fix uses local variables for the postprocessor and errorHandler return
values, only checking for HTTP_STATUS_CLOSE without modifying status_code.
This preserves the UNFINISHED status while still supporting the
HTTP_STATUS_CLOSE feature added in commit 62cd137.
Agent-Logs-Url: https://github.com/ithewei/libhv/sessions/aa478496-9e54-4c62-b0f7-810817b3867f
Co-authored-by: ithewei <26049660+ithewei@users.noreply.github.com>
* Refactor postprocessor variable name for clarity
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ithewei <26049660+ithewei@users.noreply.github.com>
Co-authored-by: ithewei <ithewei@163.com>1 parent 9eac0bc commit 3a8c195
1 file changed
+12
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
485 | 490 | | |
486 | 491 | | |
487 | 492 | | |
488 | 493 | | |
489 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
490 | 499 | | |
491 | 500 | | |
492 | 501 | | |
493 | 502 | | |
494 | 503 | | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | 504 | | |
501 | 505 | | |
502 | 506 | | |
| |||
505 | 509 | | |
506 | 510 | | |
507 | 511 | | |
508 | | - | |
509 | | - | |
| 512 | + | |
| 513 | + | |
510 | 514 | | |
511 | 515 | | |
512 | 516 | | |
| |||
0 commit comments