also the context when dialing an address

This commit is contained in:
Marten Seemann 2022-03-25 10:11:55 +01:00
parent 137491916b
commit d3fab2a230
3 changed files with 13 additions and 17 deletions

View file

@ -36,7 +36,7 @@ var defaultQuicConfig = &quic.Config{
type dialFunc func(ctx context.Context, network, addr string, tlsCfg *tls.Config, cfg *quic.Config) (quic.EarlySession, error)
var dialAddr = quic.DialAddrEarly
var dialAddr = quic.DialAddrEarlyContext
type roundTripperOpts struct {
DisableCompression bool
@ -103,7 +103,7 @@ func (c *client) dial(ctx context.Context) error {
if c.dialer != nil {
c.session, err = c.dialer(ctx, "udp", c.hostname, c.tlsConf, c.config)
} else {
c.session, err = dialAddr(c.hostname, c.tlsConf, c.config)
c.session, err = dialAddr(ctx, c.hostname, c.tlsConf, c.config)
}
if err != nil {
return err