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

proto: make initial destination cid configurable #1897

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

thynson
Copy link
Contributor

@thynson thynson commented Jun 15, 2024

This PR implements #1896.

@thynson thynson force-pushed the configurable-initial-remote-cid branch 3 times, most recently from d92a939 to 9179f71 Compare June 15, 2024 04:49
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

Looks reasonable, thanks!

quinn-proto/src/config.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

On second thought, should this be a field of ClientConfig? It's only needed for outgoing connections, after all.

quinn-proto/src/config.rs Outdated Show resolved Hide resolved
@thynson
Copy link
Contributor Author

thynson commented Jun 18, 2024

On second thought, should this be a field of ClientConfig? It's only needed for outgoing connections, after all.

I tried but was stuck with the mutability of the ClientConfig. Maybe some interior mutability pattern should applied here. A mutex is required to do so.

I'll find some time to implement a ClientConfig version in a couple of days.

@djc
Copy link
Member

djc commented Jun 18, 2024

On second thought, should this be a field of ClientConfig? It's only needed for outgoing connections, after all.

I tried but was stuck with the mutability of the ClientConfig. Maybe some interior mutability pattern should applied here. A mutex is required to do so.

I'll find some time to implement a ClientConfig version in a couple of days.

Not sure what you mean? EndpointConfig ends up in an Arc inside Endpoint::config, too, so how is the mutability of ClientConfig different/an issue?

@thynson
Copy link
Contributor Author

thynson commented Jun 18, 2024

On second thought, should this be a field of ClientConfig? It's only needed for outgoing connections, after all.

I tried but was stuck with the mutability of the ClientConfig. Maybe some interior mutability pattern should applied here. A mutex is required to do so.
I'll find some time to implement a ClientConfig version in a couple of days.

Not sure what you mean? EndpointConfig ends up in an Arc inside Endpoint::config, too, so how is the mutability of ClientConfig different/an issue?

The EndpointConfig holds an Arc of a factory, when building an Endpoint, an instance of Box<dynConnectionIdGenerator> is obtained from the factory, so the mutability issue is not applied there.

@thynson
Copy link
Contributor Author

thynson commented Jun 18, 2024

Updated to move it to ClientConfig

@thynson thynson force-pushed the configurable-initial-remote-cid branch 2 times, most recently from 9d7ff87 to 8cef4b2 Compare June 18, 2024 14:44
quinn-proto/src/endpoint.rs Outdated Show resolved Hide resolved
@thynson
Copy link
Contributor Author

thynson commented Jun 18, 2024

Added a commit that replaces ConnectionIdGenerator with function trait instead.
It will be squashed if approved.

@thynson thynson force-pushed the configurable-initial-remote-cid branch 4 times, most recently from 6ec8f5d to 84d062b Compare June 18, 2024 15:22
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

In the long run I want to make ConnectionIdGenerator::generate_cid take &self so we can share them more readily and do away with factories, but that'll be a breaking change regardless, so for simplicity in the short term I think I agree that a function trait object makes the most sense.

quinn-proto/src/config.rs Outdated Show resolved Hide resolved
quinn-proto/src/config.rs Outdated Show resolved Hide resolved
@thynson thynson force-pushed the configurable-initial-remote-cid branch from 84d062b to 70519d9 Compare June 19, 2024 01:19
@thynson thynson changed the title proto: make the cid generator for initial remote cid configurable proto: make the cid generator for initial destination cid configurable Jun 19, 2024
@thynson thynson changed the title proto: make the cid generator for initial destination cid configurable proto: make initial destination cid configurable Jun 19, 2024
@thynson thynson force-pushed the configurable-initial-remote-cid branch from 70519d9 to ea3b6b0 Compare June 19, 2024 07:03
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

Thanks!

@Ralith Ralith force-pushed the configurable-initial-remote-cid branch from ea3b6b0 to a93d6d0 Compare June 21, 2024 01:41
@Ralith Ralith enabled auto-merge (rebase) June 21, 2024 01:44
@Ralith Ralith merged commit 03fe15f into quinn-rs:main Jun 21, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants