Merge pull request #3359 from lucas-clemente/http3-dial-context

respect the request context when dialing
This commit is contained in:
Marten Seemann
2022-03-25 10:27:43 +01:00
committed by GitHub
4 changed files with 42 additions and 46 deletions

View File

@@ -1,6 +1,7 @@
package http3
import (
"context"
"crypto/tls"
"errors"
"fmt"
@@ -48,8 +49,8 @@ type RoundTripper struct {
// Dial specifies an optional dial function for creating QUIC
// connections for requests.
// If Dial is nil, quic.DialAddrEarly will be used.
Dial func(network, addr string, tlsCfg *tls.Config, cfg *quic.Config) (quic.EarlySession, error)
// If Dial is nil, quic.DialAddrEarlyContext will be used.
Dial func(ctx context.Context, network, addr string, tlsCfg *tls.Config, cfg *quic.Config) (quic.EarlySession, error)
// MaxResponseHeaderBytes specifies a limit on how many response bytes are
// allowed in the server's response header.