Skip to content

websocket: auto PONG with client reader fix - #23296

Closed
icing wants to merge 1 commit into
curl:masterfrom
icing:ws-auto-pong-w-reader
Closed

icing wants to merge 1 commit into
curl:masterfrom
icing:ws-auto-pong-w-reader

Conversation

@icing

@icing icing commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

When getting websocket upload data via a client reader, the download code path MUST NOT send PONG frames directly to the connection. Instead those control frames need to be picked up by the client reader.

Add a flag in the webocket context when a client reader is setup and refrain from sending in download writes/receives.

reported-by: anthropic

When getting websocket upload data via a client reader, the
download code path MUST NOT send PONG frames directly to the
connection. Instead those control frames need to be picked up
by the client reader.

Add a flag in the webocket context when a client reader is setup
and refrain from sending in download writes/receives.

reported-by: anthropic
@icing
icing requested a review from bagder October 7, 2026 09:48

Copilot AI 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.

🟡 Changes recommended

Pending PONGs can remain unsent when the upload reader is paused or has reached EOS.

1 open finding
What changed in this PR

Adjusts WebSocket auto-PONG handling when uploads use a client reader.

Changes:

  • Tracks whether sending is reader-managed.
  • Avoids direct PONG flushing from receive paths.
  • Marks encoded WebSocket upload length as indeterminate.
File Description
lib/​ws.c Coordinates PONG handling with client-reader uploads.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/ws.c Resolved
@bagder bagder closed this in 39b0693 Oct 8, 2026
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.

3 participants