Fix inverted bt-list check in session handshake parsing#46
Open
jagerman wants to merge 1 commit into
Open
Conversation
The `else if` branch in handle_session_handshake had an inverted
condition: `payload.front() != std::byte{'l'}` fed non-list data into
bt_list_consumer while routing actual bt-lists to the "unknown data"
rejection branch. Since the bt-list form is the 1.0 backwards-compat
path-switch format, this broke path switches from 1.0 peers.
Invert to `== std::byte{'l'}` so lists are parsed as lists and only
genuinely non-dict/non-list payloads hit the rejection branch.
Also correct the misplaced/mis-worded format comment: the "2-element
[0]/[1]" description belongs on the 'l' (bt-list, 1.0) branch, not the
'd' (bt-dict, new 1.1 PFS+PQ) branch.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
The
else ifbranch in handle_session_handshake had an inverted condition:payload.front() != std::byte{'l'}fed non-list data into bt_list_consumer while routing actual bt-lists to the "unknown data" rejection branch. Since the bt-list form is the 1.0 backwards-compat path-switch format, this broke path switches from 1.0 peers.Invert to
== std::byte{'l'}so lists are parsed as lists and only genuinely non-dict/non-list payloads hit the rejection branch.Also correct the misplaced/mis-worded format comment: the "2-element [0]/[1]" description belongs on the 'l' (bt-list, 1.0) branch, not the 'd' (bt-dict, new 1.1 PFS+PQ) branch.
(Fix for the issue noticed in PR #44)