Conversation
|
@icing can you think of any way to do the fix differently to reduce friction for users ? |
For link compatibility, we would define a new |
Oh, I like that. Will adjust. |
The two bitmask constants for *CLEAR_DNS and *CLEAR_CONNS were duplicates (both set to 1), so they cannot be distinguished and both actions fire. This shipped in public releases since 8.16.0 to and include 8.19.0. This fix adds CURLMNWC_CLEAR_ALL to be the new 1, and it now implies all bits. The DNS and CONNS defines get two new bits (2, 4). Follow-up to 55c045c Found by Codex Security Closes #20968
81a9ba1 to
45bdbb3
Compare
There was a problem hiding this comment.
Pull request overview
Fixes an API/behavior issue in CURLMOPT_NETWORK_CHANGED where the CURLMNWC_CLEAR_CONNS and CURLMNWC_CLEAR_DNS bitmasks were identical, making them indistinguishable and causing both actions to trigger.
Changes:
- Introduces
CURLMNWC_CLEAR_ALLand assigns distinct bit values toCURLMNWC_CLEAR_CONNSandCURLMNWC_CLEAR_DNS. - Updates
curl_multi_setopt(CURLMOPT_NETWORK_CHANGED, ...)handling to preserve legacy behavior where the old value1implied “clear all”. - Documents the new symbol/version in
symbols-in-versionsand updates the option documentation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lib/multi.c | Adds CURLMNWC_CLEAR_ALL handling to map legacy 1 to “clear DNS + conns”. |
| include/curl/multi.h | Defines CURLMNWC_CLEAR_ALL and assigns unique bits to CONNS/DNS. |
| docs/libcurl/symbols-in-versions | Records CURLMNWC_CLEAR_ALL as added in 8.20.0. |
| docs/libcurl/opts/CURLMOPT_NETWORK_CHANGED.md | Documents CURLMNWC_CLEAR_ALL and refreshes formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The two bitmask constants for *CLEAR_DNS and *CLEAR_CONNS were duplicates (both set to 1), so they cannot be distinguished and both actions fire. This shipped in public releases since 8.16.0 to and include 8.19.0. This fix adds CURLMNWC_CLEAR_ALL to be the new 1, and it now implies all bits. The DNS and CONNS defines get two new bits (2, 4). Follow-up to 55c045c Found by Codex Security Closes #20968
18c9560 to
7e4380d
Compare
The two bitmask constants for *CLEAR_DNS and *CLEAR_CONNS are duplicates, so they cannot be distinguished and both actions fire.
This shipped in public releases since 8.16.0 to and include 8.19.0.
This update unfortunately subtly changes the public API, but I see no alternative.
Follow-up to 55c045c
Found by Codex Security