always use Curl_1st_fatal instead of Curl_1st_err#20980
Closed
icing wants to merge 1 commit intocurl:masterfrom
Closed
always use Curl_1st_fatal instead of Curl_1st_err#20980icing wants to merge 1 commit intocurl:masterfrom
icing wants to merge 1 commit intocurl:masterfrom
Conversation
Curl_1st_err() does not return the second error if the first result is CURLE_AGAIN. This may cause errors to not become noticeable when they should be. Replace all use of Curl_1st_err() with Curl_1st_fatal(), which handles CURLE_AGAIN as a not-a-real-error case.
bagder
approved these changes
Mar 18, 2026
There was a problem hiding this comment.
Pull request overview
This PR removes Curl_1st_err() and standardizes error-combination logic on Curl_1st_fatal(), fixing cases where a prior CURLE_AGAIN result could mask a subsequent real error (notably in HTTP/3/QUIC egress/expiry paths).
Changes:
- Replaced remaining
Curl_1st_err()call sites withCurl_1st_fatal()in QUIC (quiche/ngtcp2) and core transfer paths. - Removed
Curl_1st_err()declaration fromlib/url.hand its implementation fromlib/url.c.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/vquic/curl_quiche.c | Uses Curl_1st_fatal() when combining CURLE_AGAIN with egress flush results so real errors aren’t masked. |
| lib/vquic/curl_ngtcp2.c | Uses Curl_1st_fatal() to ensure egress/expiry errors surface even when the main operation yields CURLE_AGAIN. |
| lib/url.h | Removes the Curl_1st_err() prototype; keeps Curl_1st_fatal() as the supported helper. |
| lib/url.c | Removes the Curl_1st_err() implementation, leaving Curl_1st_fatal() as the sole helper. |
| lib/multi.c | Ensures Curl_xfer_write_done() errors aren’t hidden by a prior CURLE_AGAIN. |
| lib/http.c | Ensures late header-write errors aren’t masked by a prior CURLE_AGAIN. |
| lib/easy.c | Ensures pause/unpause helper errors aren’t masked by a prior CURLE_AGAIN. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
dkarpov1970
pushed a commit
to dkarpov1970/curl
that referenced
this pull request
Mar 25, 2026
Curl_1st_err() does not return the second error if the first result is CURLE_AGAIN. This may cause errors to not become noticeable when they should be. Replace all use of Curl_1st_err() with Curl_1st_fatal(), which handles CURLE_AGAIN as a not-a-real-error case. Closes curl#20980
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.
Curl_1st_err() does not return the second error if the first result is CURLE_AGAIN. This may cause errors to not become noticeable when they should be.
Replace all use of Curl_1st_err() with Curl_1st_fatal(), which handles CURLE_AGAIN as a not-a-real-error case.