Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch Param Id's to not be overlapping #1758

Merged
merged 5 commits into from
Jun 23, 2021

Conversation

ThadHouse
Copy link
Contributor

@ThadHouse ThadHouse commented Jun 22, 2021

This is done by making the bottom 26 bits be the Param Id and the top 6 bits be the level.

This is able to be done as a non breaking change by making the level Id always the enum value + 1. This means that if the level is 0, we're running against an older caller, and the level passed in is used. If the level is non 0, so a new caller, the level is checked against the level parameter passed in. If these do not match, INVALID_PARAMETER is returned. In a future breaking change, the separate level param can be removed entirely, but this is a working solution for now that will make the API less error prone.

26 bits was chosen as we had a parameter that was already using bit 24. This leaves 63 valid levels. Above 32 is reserved for private levels, so we have 31 levels for future use.

Fixes #1708

@ThadHouse ThadHouse requested a review from a team as a code owner June 22, 2021 21:02
Copy link
Member

@nibanks nibanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discuss on IM

src/core/api.c Show resolved Hide resolved
src/inc/msquic.h Outdated Show resolved Hide resolved
src/core/api.c Outdated Show resolved Hide resolved
@ThadHouse ThadHouse merged commit 0aafb06 into main Jun 23, 2021
@ThadHouse ThadHouse deleted the thadhouse/separateparamversions branch June 23, 2021 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

possibly make param ids non overlapping
3 participants