Repository navigation
websocket: add option to disable auto-pong reply - #16744
Closed
viscruocco wants to merge 8 commits into
Closed
viscruocco wants to merge 8 commits into
viscruocco wants to merge 8 commits into
Conversation
This was referenced Mar 17, 2025
vszakats
reviewed
Mar 17, 2025
Contributor
Author
|
Does anything remain to do, to move this PR forward? |
Member
|
@viscruocco the PR itself looks fine - now we only need to wait for the feature window to open again to allow new features such as this to get merged (for 8.14.0). The feature window for 8.13.0 closed a few weeks ago. You can prepare for this to make sure the PR speaks of the correct version for this feature. The feature window is planned to open again on April 12. |
viscruocco
commented
Mar 25, 2025
viscruocco
commented
Apr 9, 2025
viscruocco
marked this pull request as draft
April 9, 2025 13:55
viscruocco
force-pushed
the
no-auto-pong
branch
from
April 14, 2025 15:15
08583c0 to
3390d40
Compare
viscruocco
commented
Apr 14, 2025
viscruocco
marked this pull request as ready for review
April 14, 2025 15:22
This adds another bitflag on CURLOPT_WS_OPTIONS (CURLWS_NOAUTOPONG) that disables the default and automatic PONG reply in the WebSocket layer. Authored-by: brimonk on github
Co-authored-by: Viktor Szakats <[email protected]>
viscruocco
force-pushed
the
no-auto-pong
branch
from
April 16, 2025 08:05
3390d40 to
0d298e0
Compare
bagder
approved these changes
Apr 18, 2025
Member
|
Thanks, both of you! |
nbaws
pushed a commit
to nbaws/curl
that referenced
this pull request
Apr 26, 2025
This adds another bitflag on CURLOPT_WS_OPTIONS (CURLWS_NOAUTOPONG) that disables the default and automatic PONG reply in the WebSocket layer. Assisted-by: Calvin Ruocco Closes curl#16744
nbaws
pushed a commit
to nbaws/curl
that referenced
this pull request
Apr 26, 2025
This adds another bitflag on CURLOPT_WS_OPTIONS (CURLWS_NOAUTOPONG) that disables the default and automatic PONG reply in the WebSocket layer. Assisted-by: Calvin Ruocco Closes curl#16744
This was referenced Oct 15, 2026
vszakats
added a commit
that referenced
this pull request
Oct 16, 2026
…ol type Setting the `CURLWS_NOAUTOPONG` flag via the `CURLOPT_WS_OPTIONS` `curl_easy_setopt()` API failed to enable this flag in libcurl builds using a compiler without a native C99 bool type. This in turn caused 2700, 2709, 2711, 2712 WebSocket tests to fail. The initial WebSocket code assigned `arg & CURLWS_RAW_MODE` to a bit-field, after casting the expression to `bool`. This worked because `CURLWS_RAW_MODE` equals 1. Later this line was cloned when adding support for `CURLWS_NOAUTOPONG`, but this new bit flag's value was 2. Casting it to `bool` and then assigning it to a bit-field worked as expected, as long as the bool type was the C99 one. On compilers without the C99 bool type, the interim cast did not work, and when assigning the value 2 to the bit-field, it ended up storing zero/false unconditionally. Such compilers are VS2012 and VS2010. For them, another trigger was a subsequent update that enabled bit-field support for MSVC compilers. Fix by replacing the `(bool)` cast with `!!`. Also for `CURLWS_RAW_MODE`, to not rely on the literal value of this macro, and to avoid reusing this pattern in future code. There were no other places in the codebase with this pattern. The rest use either `!!` or ternary expression for this type of conversion. Discovered while trying to enable tests for MSVC builds in AppVeyor CI, causing test failures with VS2012 and VS2010. Refs: https://en.cppreference.com/c/language/arithmetic_types#Boolean_type https://en.cppreference.com/c/language/conversion https://godbolt.org/z/3h5zMfePq Bug: #23306 (comment) Bug: #23306 (comment) Follow-up to 85c841c #20142 Follow-up to c0df01f #16744 Follow-up to 664249d #8995 Cherry-picked from #23306 Closes #23428
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.
Rebased #12220 with kind permission of @brimonk.
Additionally added some more documentation and explicitly initialized CURLOPT_WS_OPTIONS values to their defaults.