Skip to content

backend/curl handle pause related errors#46

Merged
bdbai merged 2 commits intomainfrom
curl/fix-pause
Mar 10, 2026
Merged

backend/curl handle pause related errors#46
bdbai merged 2 commits intomainfrom
curl/fix-pause

Conversation

@bdbai
Copy link
Copy Markdown
Owner

@bdbai bdbai commented Mar 10, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the curl backend's handling of pause-related errors in the async path. Previously, errors from curl_easy_pause and unpause operations were silently ignored (.ok()). Now they are properly propagated to the consumer as request failures. The write callback is also refactored to use WriteError::Pause (returning CURL_WRITEFUNC_PAUSE) instead of explicitly calling curl_easy_pause from within the callback.

Changes:

  • Replace explicit pause_recv() in the write callback with Err(WriteError::Pause) and add error handling for pause_recv() in the header callback
  • Propagate errors from unpause_recv()/unpause_send()/pause_send() in the event loop as RequestResult::Done errors instead of silently ignoring them
  • Add is_recv_unpause_sent flag to deduplicate unpause requests, and rename poll_bytes_async to wait_for_bytes

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
backends/curl/src/async/handler.rs Refactored write callback to use WriteError::Pause for backpressure; added error handling for pause_recv() in header callback
backends/curl/src/async/loop.rs Added is_recv_unpause_sent flag to deduplicate unpause tasks; propagated errors from unpause/pause operations; renamed poll_bytes_async to wait_for_bytes
backends/curl/src/async/pause.rs Changed pause_recv() to return Result<(), CurlCodeContext> instead of ()
backends/curl/src/state.rs Added data_available() helper method (async-only)
backends/curl/src/async.rs Updated call site from poll_bytes_async to wait_for_bytes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bdbai bdbai merged commit f5061bb into main Mar 10, 2026
31 checks passed
@bdbai bdbai deleted the curl/fix-pause branch March 10, 2026 16:31
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.

2 participants