forked from quic-go/quic-go
pass a context to Transport.ConnContext (#4536)
* pass a context to Transport.ConnContext This context is cancelled when the QUIC connection is closed, or when the QUIC handshake fails. This allows the application to easily build and garbage collect a map of active connections. * correctly handle fresh contexts returned from ConnContext
This commit is contained in:
@@ -600,9 +600,9 @@ var _ = Describe("HTTP tests", func() {
|
||||
defer conn.Close()
|
||||
tr := &quic.Transport{
|
||||
Conn: conn,
|
||||
ConnContext: func() context.Context {
|
||||
ConnContext: func(ctx context.Context) context.Context {
|
||||
//nolint:staticcheck
|
||||
return context.WithValue(context.Background(), "foo", "bar")
|
||||
return context.WithValue(ctx, "foo", "bar")
|
||||
},
|
||||
}
|
||||
defer tr.Close()
|
||||
|
||||
Reference in New Issue
Block a user