From dc25d7b66697ed6ce25f0e3ba3668d332588294c Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 17 Oct 2022 09:54:04 +0100 Subject: [PATCH] http3: add a Context method to the StreamCreator interface --- http3/body.go | 2 ++ interface.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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.