Skip to content

No WebTransport session-close receive or send API #349

Description

@spotdemo4

Version

h3-webtransport 0.1.2

Platform

Linux desktop 7.1.7 NixOS x86_64 GNU/Linux

Summary

h3-webtransport doesn't expose a session-close receive or send API, preventing users from reporting a browser's WebTransport close code/reason or sending its own close reason during a graceful shutdown

Code Sample

Peer pseudocode:

let mut connect = establish_extended_connect().await?;
connect
    .send_capsule(CloseWebTransportSession {
        code: 42,
        reason: "client shutdown".into(),
    })
    .await?;
connect.finish().await?;

Expected Behavior

The session API should expose both directions of the WebTransport session lifecycle, for example:

session.closed().await -> SessionClose
session.close(code, reason).await

The implementation should parse and emit the applicable capsule on the CONNECT stream while continuing to drive ordinary session streams.

Actual Behavior

WebTransportSession privately retains the CONNECT request stream as connect_stream, but does not poll its body for capsules and exposes no method to:

  • receive a peer CloseWebTransportSession capsule,
  • send a CloseWebTransportSession capsule,
  • close with a WebTransport close code and reason, or
  • await session closure independently of whole HTTP/3 connection closure.

Consequently, graceful server shutdown can only drain RPCs and close the underlying HTTP/3 connection. A peer session-close capsule is not surfaced to application code through accept_bi() or another session future.

Suggested upstream fix

Add a CONNECT-stream capsule driver owned by WebTransportSession, plus explicit close and closed APIs. Session close must remain independent of ordinary HTTP/3 connection shutdown and should preserve the close code and reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions