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.
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
Connector:
enable_all_versions
with matching alpn vs features #224Connector:
enable_all_versions
with matching alpn vs features #224Changes from all commits
191d8bd
0b4b6e1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going to do this, let's get rid of the
http2
guard? And make it work for all of the possible combinations?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, that seems like the right direction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djc
The problem with not having the
http2
guard is that the return type would change (sinceWantsProtocols3
wont exist). So if any library enables the feature it might cause other libraries to not compile if they expectedWantsProtocols2
. Since enabling an extra feature in a deep dependency doesn't usually warrant a major version release, things in the wild could spontaneously break if one single library enables it when one other doesn't expect it.Making the feature combination non-breaking would require wrapping the actual inner type
WantsProtocolsN
(based on the highest enabled protocol feature) in aWantsProtocolsAll
singleton struct and always returning that. That would be a breaking change for this library, however, which is why I didn't want to do it in this fix.If a version of this fix gets merged I could create a new PR with the above solution with a new breaking return type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems reasonable, I'd be willing to merge this in order to get this improvement out provided you submit an additional PR to do the semver-breaking fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test is only checking the result of using
enable_all_versions
with both the http1 and http2 feature flags enabled based on the guard ontest_alpn
. Ideally we could assert the correct state for more combinations than just this case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I realized this too. I locally created an additional test case for only
http2
while I was writing the PR description. I suspected that I'd get feedback on the doc line so I didn't want to muddy the waters with an additional small commit. But I'll push it now.