Honor client_no_context_takeover offer#1194
Open
jhugard wants to merge 2 commits intozaphoyd:developfrom
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Problem (#1193)
In the default WebSocket++
permessage-deflateclient configuration, the client offer generated bygenerate_offer()advertisesclient_no_context_takeover, but client-side compression behavior only honors that setting when the server echoes the parameter in its response. If the server acceptspermessage-deflateand omitsclient_no_context_takeover, the client still reuses compressor context across messages.This means the offer string and the actual outbound behavior can diverge.
Branch and commit series
permessage-deflate-client-no-context-takeoverorigin/developThis branch contains two commits:
b8e4b6f—Add client_no_context_takeover regression test6ed4712—Honor client_no_context_takeover offerOverview of changes
The fix keeps track of whether the client advertised
client_no_context_takeoveringenerate_offer()and carries that offer-side state into the clientinit(false)path.With that state available at initialization time, the client uses no-context-takeover compression behavior for outbound messages even when the server omits
client_no_context_takeoverfrom the negotiated response parameters.Tests
Added coverage in
test/extension/permessage_deflate.cppfor the case where:client_no_context_takeoverValidation
Reviewer flow:
b8e4b6fand run the new regression (expected to fail)6ed4712and rerun (expected to pass)Observed behavior:
Files touched
test/extension/permessage_deflate.cppwebsocketpp/extensions/permessage_deflate/enabled.hppTarget branch
Per repository guidance in
readme.md, this series is based on and intended fordevelop.