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

Support for changing alpn on listener callback (#2418) #2959

Merged

Conversation

liveans
Copy link
Member

@liveans liveans commented Aug 9, 2022

Description

Closes #2418. This pr aims to support changing alpns on ListenerCallback via the NewNegotiatedAlpn field.

Testing

Alpn.ChangeAlpn test case already added, also extended that test case to check out of bounds and invalid address.

Documentation

Yes, example usage can be found under QUIC_LISTENER_EVENT.md

src/core/binding.c Outdated Show resolved Hide resolved
src/core/listener.c Outdated Show resolved Hide resolved
src/core/listener.c Outdated Show resolved Hide resolved
src/core/listener.c Outdated Show resolved Hide resolved
@liveans liveans marked this pull request as ready for review August 9, 2022 19:16
@liveans liveans requested a review from a team as a code owner August 9, 2022 19:16
docs/api/ListenerStop.md Outdated Show resolved Hide resolved
Co-authored-by: Nick Banks <nibanks@microsoft.com>
liveans and others added 2 commits August 9, 2022 22:20
Co-authored-by: Nick Banks <nibanks@microsoft.com>
src/core/listener.c Outdated Show resolved Hide resolved
src/core/listener.c Outdated Show resolved Hide resolved
src/core/listener.c Outdated Show resolved Hide resolved
src/core/listener.c Outdated Show resolved Hide resolved
@nibanks
Copy link
Member

nibanks commented Aug 9, 2022

/azp run ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nibanks
Copy link
Member

nibanks commented Aug 9, 2022

/azp run ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nibanks
Copy link
Member

nibanks commented Aug 9, 2022

/azp run ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

src/core/listener.c Outdated Show resolved Hide resolved
@nibanks
Copy link
Member

nibanks commented Aug 9, 2022

/azp run ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

Thanks so much for doing this!

@nibanks nibanks merged commit 5d850f7 into microsoft:main Aug 10, 2022
Copy link
Member

@ManickaP ManickaP left a comment

Choose a reason for hiding this comment

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

I don't fully understand the changes here, but we don't need any API changes. What we need is to be able to narrow down ALPN list when we call ConnectionSetConfiguration after we got NEW_CONNECTION. Note that this needs to be asynchronous since we're invoking user provided async callback, so we cannot set it within NEW_CONNECTION event.

The configuration already supports setting ALPN, we just need msquic to handle it for inbound connections.

@@ -1820,6 +1820,9 @@ internal unsafe partial struct _NEW_CONNECTION_e__Struct

[NativeTypeName("HQUIC")]
internal QUIC_HANDLE* Connection;

[NativeTypeName("const uint8_t *")]
internal byte* NewNegotiatedAlpn;
Copy link
Member

Choose a reason for hiding this comment

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

What's this good for? And shouldn't it also have length specified somewhere?

@liveans
Copy link
Member Author

liveans commented Aug 10, 2022

I'll make a new PR for this to correct the behavior @ManickaP

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.

Support Callback Negotiation Between Matching ALPNs
3 participants