Skip to content

Settings #10

Closed
Closed
@stammw

Description

@stammw

@seanmonstar's proposal contains a builder API for connection that would accept the few settings available defined by HTTP/3, and QPACK:

Connection::builder().max_field_section_size(1024 * 64).handshake(quic_connection)

While this is clearly an ergonomic advantage for the user, I think we should also have a Settings type:

  • This makes it possible to reuse the same settings for many connections.
  • Yes ConnecitonBuilder::handshake() could take &self instead of self
  • But maybe we'd like to be sure we're in possession of a valid Settings (of which parameters need to be bound-checked).
  • Having a type for that is an opportunity to "encapsulate" bound checks and default values.

The QPACK settings are not to be neglected even if the plan is not to integrate QPACK for now because it blocks streams: Headers are always encoded with QPACK, what changes when disabling it is that there is no dynamic table in the encoding game. This configuration is linked to qpack's SETTINGS_QPACK_MAX_TABLE_CAPACITY: a value of 0 means this is disabled.

The Settings type, available from a builder-pattern thing, can be passed when building a connection, like so:

let settings = Settings::builder()
    .max_field_section_size(1024 * 64)
    .qpack_max_table_capacity(4096)
    .build()?;
  
Connection::builder().settings(settings).handshake(server1)
Connection::builder().settings(settings).handshake(server2)

I've got a similar type in quinn_h3::Settings, but the ergonomics are not that great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions