Skip to content

proxy: chunked response, error code - #21084

Closed
icing wants to merge 3 commits into
curl:masterfrom
icing:proxy-chunked-error
Closed

icing wants to merge 3 commits into
curl:masterfrom
icing:proxy-chunked-error

Conversation

@icing

@icing icing commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Add test1715 to check proper handling of chunked transfer encoding in CONNECT responses. Change proxy error code from 56 (RECV_ERROR) for everything to 7 (COULDNT_CONNECT) when the server response could be read successfully, but establishing the connection is not possible (http status code wrong).

Adapt several test expectations from 56 to 7.

Add test1715 to check proper handling of chunked transfer
encoding in CONNECT responses. Change proxy error code from
56 (RECV_ERROR) for everything to 7 (COULDNT_CONNECT) when
the server response could be read successfully, but establishing
the connection is not possible (http status code wrong).

Adapt several test expectations from 56 to 7.
@icing
icing requested a review from bagder March 24, 2026 09:41
@bagder

bagder commented Mar 24, 2026

Copy link
Copy Markdown
Member

augment review

@augmentcode

augmentcode Bot commented Mar 24, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Improves proxy CONNECT tunnel error reporting and adds coverage for tricky CONNECT responses.

Changes:

  • Adjust HTTP/1 CONNECT response draining to prioritize Transfer-Encoding: chunked over Content-Length when ignoring a response body.
  • Change CONNECT-tunnel failures with a fully readable non-2xx response to return CURLE_COULDNT_CONNECT (HTTP/1 and HTTP/2 proxy filters).
  • Add a new regression test (test1715) and update existing test expectations (including Python tests) to match the new exit code semantics.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread lib/cf-h1-proxy.c Outdated
@icing
icing requested a review from bagder March 24, 2026 12:50
@bagder bagder closed this in a186ecf Mar 25, 2026
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
Add test1715 to check proper handling of chunked transfer
encoding in CONNECT responses. Change proxy error code from
56 (RECV_ERROR) for everything to 7 (COULDNT_CONNECT) when
the server response could be read successfully, but establishing
the connection is not possible (http status code wrong).

Adapt several test expectations from 56 to 7.

Closes curl#21084
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants