Repository navigation
Conversation
Replace the "in event callback" concept with a flag that makes callback enforce "read only" mode. All easy calls that do not modify the easy handle are marked as "reasd only". With a "readonly" callback active, only "readonly" easy calls can be made. This extends the restrictions from the "event" callbacks to the "debug" callback as well. Any modifications to an easy handle during event/debug callbacks is now denied. Formerly, we only restricted curl_easy_pause(), but now the list of blocked calls is much larger. THere is a risk to that, but we call "debug" from possibly all cases and are not able to handle modifications in that call safely.
icing
force-pushed
the
api-readonly-checks
branch
from
October 19, 2026 10:24
2c359d6 to
add214f
Compare
bagder
approved these changes
Oct 19, 2026
There was a problem hiding this comment.
🟡 Changes recommended
Debug callbacks on easy handles without a multi association still bypass read-only enforcement.
1 open issue
What changed in this PR
Replaces event-specific API restrictions with read-only callback enforcement for libcurl easy handles.
Changes:
- Marks non-mutating easy APIs as read-only.
- Extends callback restrictions to debug callbacks and blocks additional mutating calls.
| File | Description |
|---|---|
| lib/api.c | Defines read-only API properties and enforces callback restrictions. |
Review effort: Balanced
bagder
approved these changes
Oct 20, 2026
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.

Replace the "in event callback" concept with a flag that makes callback enforce "read only" mode. All easy calls that do not modify the easy handle are marked as "read only".
With a "readonly" callback active, only "readonly" easy calls can be made.
This extends the restrictions from the "event" callbacks to the "debug" callback as well. Any modifications to an easy handle during event/debug callbacks is now denied.
Formerly, we only restricted curl_easy_pause(), but now the list of blocked calls is much larger. There is a risk to that, but we call "debug" from possibly all cases and are not able to handle modifications in that call safely.