diff --git a/http3/body.go b/http3/body.go index d6e704ebcb1..26946252fbc 100644 --- a/http3/body.go +++ b/http3/body.go @@ -18,6 +18,8 @@ type HTTPStreamer interface { } type StreamCreator interface { + // Context returns a context that is cancelled when the underlying connection is closed. + Context() context.Context OpenStream() (quic.Stream, error) OpenStreamSync(context.Context) (quic.Stream, error) OpenUniStream() (quic.SendStream, error) diff --git a/interface.go b/interface.go index 8fbeab1f10d..492d3b0cf5a 100644 --- a/interface.go +++ b/interface.go @@ -173,7 +173,7 @@ type Connection interface { // CloseWithError closes the connection with an error. // The error string will be sent to the peer. CloseWithError(ApplicationErrorCode, string) error - // The context is cancelled when the connection is closed. + // Context returns a context that is cancelled when the connection is closed. Context() context.Context // ConnectionState returns basic details about the QUIC connection. // It blocks until the handshake completes.