forked from quic-go/quic-go
pass ClientInfo to Transport.ConnContext, allow rejection of handshake (#5122)
* pass *ClientInfo to ConnContext This allows users to set some state related to the client's remote address in `ConnContext`. This also refuses connection early if the returned context is cancelled. * review comments * better error assertion --------- Co-authored-by: Marten Seemann <martenseemann@gmail.com>
This commit is contained in:
@@ -614,8 +614,8 @@ func TestHTTPContextFromQUIC(t *testing.T) {
|
||||
conn := newUDPConnLocalhost(t)
|
||||
tr := &quic.Transport{
|
||||
Conn: conn,
|
||||
ConnContext: func(ctx context.Context) context.Context {
|
||||
return context.WithValue(ctx, "foo", "bar") //nolint:staticcheck
|
||||
ConnContext: func(ctx context.Context, _ *quic.ClientInfo) (context.Context, error) {
|
||||
return context.WithValue(ctx, "foo", "bar"), nil
|
||||
},
|
||||
}
|
||||
defer tr.Close()
|
||||
|
||||
Reference in New Issue
Block a user