Conversation
There was a problem hiding this comment.
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 withErr(WriteError::Pause)and add error handling forpause_recv()in the header callback - Propagate errors from
unpause_recv()/unpause_send()/pause_send()in the event loop asRequestResult::Doneerrors instead of silently ignoring them - Add
is_recv_unpause_sentflag to deduplicate unpause requests, and renamepoll_bytes_asynctowait_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.