Skip to content

fix(http): don't reuse connection when --fail skips body (test 1328)#125

Closed
jonwiggins wants to merge 1 commit intomainfrom
optio/task-4f4e8606-b8db-4435-88bf-87d637ab41b2
Closed

fix(http): don't reuse connection when --fail skips body (test 1328)#125
jonwiggins wants to merge 1 commit intomainfrom
optio/task-4f4e8606-b8db-4435-88bf-87d637ab41b2

Conversation

@jonwiggins
Copy link
Copy Markdown
Owner

Summary

  • When --fail triggers on a 4xx response, the body read is skipped but the connection was returned to the pool with unread data still on the socket
  • URL globbing then reuses that pooled connection for the next URL, causing the HTTP parser to read stale body data instead of fresh response headers, resulting in a hang
  • Fix: mark the connection as non-reusable when fail_skip is true and the response has body framing (Content-Length or chunked Transfer-Encoding)

Fixes #122

Test plan

  • Curl test 1328 passes (was hanging before)
  • Tests 1-20, 24, 1320-1340 all pass (no regressions)
  • All 925 liburlx library tests pass

🤖 Generated with Claude Code

When --fail triggers on a 4xx response, the body read is skipped but
the connection was being returned to the pool with unread body data
still on the socket. When URL globbing reuses that pooled connection
for the next URL, the HTTP parser reads stale body data instead of
fresh response headers, causing a hang.

Fix: mark the connection as non-reusable when fail_skip is true and
the response has body framing (Content-Length or chunked TE).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jonwiggins jonwiggins closed this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(http): --fail with URL globbing hangs (test 1328)

1 participant