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

HTTP/3 connection params #151

Closed
wants to merge 6 commits into from
Closed

HTTP/3 connection params #151

wants to merge 6 commits into from

Conversation

eagr
Copy link
Member

@eagr eagr commented Dec 5, 2022

Dedup client/server builders. And it's likely there will be more shared parameters in the future.

@eagr
Copy link
Member Author

eagr commented Dec 6, 2022

Should we keep the client/server builders? Also, any suggestions on the name of the parameter builder?

@Ruben2424
Copy link
Contributor

Should we keep the client/server builders?

I would keep the client/server builders because there will possibly be parameters which only belong to server or client.

Also, any suggestions on the name of the parameter builder?

Maybe just ParameterBuilder? But i'm not good with names.

h3/src/params.rs Outdated
pub const DEFAULT_MAX_FIELD_SECTION_SIZE: u64 = (1 << 62) - 1;

/// Set whether WebTransport is supported
pub fn enable_webtransport(mut self, val: bool) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to put the WebTransport stuff behind a Feature Flag. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I thought about that too. But what if it's just for params and settings?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would put WebTransport completely behind a feature flag or maybe even in a separate crate. Iirc there was some discussion about this in #71.

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand the benefits of putting stuff behind a feature gate sometimes (smaller binary, faster compilation, etc). I totally agree we should feature-gate or separate major implementations of WT.

But configs and settings are lightweight and hard to separate. The benefit of putting those behind a feature gate seems limited. I'm 100% sure about this though. What do you think? @seanmonstar

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought about it more from a User perspective. Because it may lead to confusion when you are able to set a config which will do nothing without the feature.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it makes sense. And adding that may be too soon..

Copy link
Member

Choose a reason for hiding this comment

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

I have not had the time to read the WebTransport spec, so not sure what more is needed, but: does adding this at least allow for WebTransport to be proxied? If it's needed for a proxy to simply pass the data frames along, then seems fair to include it as part of the crate, perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think so. The setting would be required to be sent by both sides when establishing connection to create a WT session.

Copy link
Contributor

@Ruben2424 Ruben2424 left a comment

Choose a reason for hiding this comment

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

Looks good here.

@eagr eagr marked this pull request as draft December 8, 2022 13:01
@eagr
Copy link
Member Author

eagr commented Dec 8, 2022

The API still feels a bit weird. There should probably be one builder instead of two: Config and Builder.

h3::config::Config {}

h3::client::Builder { config }
h3::server::Builder { config }

So, it should either be something that looks like

// somehow dedupped
h3::config::ClientConfig {}
h3::config::ServerConfig {}

// no more Builder
h3::client::new(conn, client_config)
h3::server::new(conn, server_config)

or

// somehow dedupped
h3::Endpoint::client().build(conn)
h3::Endpoint::server().build(conn)

@Ruben2424
Copy link
Contributor

I like this option better.

// somehow dedupped
h3::config::ClientConfig {}
h3::config::ServerConfig {}

// no more Builder
h3::client::new(conn, client_config)
h3::server::new(conn, server_config)

@eagr
Copy link
Member Author

eagr commented Dec 10, 2022

Yeah. Using a config struct has a potential advantage of easier mapping to settings. We could potentially have something like impl From<Config> for Settings.

@eagr eagr marked this pull request as ready for review December 11, 2022 10:16
@eagr eagr requested a review from seanmonstar December 11, 2022 10:20
@eagr
Copy link
Member Author

eagr commented Dec 12, 2022

Changed user-facing config structs to be compositions:

ClientConfig { conn: ConnectionConfig, ... }
ServerConfig { conn: ConnectionConfig, ... }

this way we could easily provide some config for the shared ConnectionInner.

@eagr eagr closed this Dec 14, 2022
@eagr eagr deleted the h3-params branch December 14, 2022 17:17
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