1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00

fix: make sure the ctx is propagated to connections by detached connection for udp dns

This commit is contained in:
Shelikhoo 2021-04-28 16:44:01 +01:00
parent d48cf1a648
commit dbfc2138e4
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -9,8 +9,6 @@ import (
"sync/atomic"
"time"
core "github.com/v2fly/v2ray-core/v4"
"github.com/lucas-clemente/quic-go"
"golang.org/x/net/dns/dnsmessage"
"golang.org/x/net/http2"
@ -372,7 +370,7 @@ func (s *QUICNameServer) openSession(ctx context.Context) (quic.Session, error)
HandshakeIdleTimeout: handshakeIdleTimeout,
}
session, err := quic.DialAddrContext(core.ToBackgroundDetachedContext(ctx), s.destination.NetAddr(), tlsConfig.GetTLSConfig(tls.WithNextProto("http/1.1", http2.NextProtoTLS, NextProtoDQ)), quicConfig)
session, err := quic.DialAddrContext(ctx, s.destination.NetAddr(), tlsConfig.GetTLSConfig(tls.WithNextProto("http/1.1", http2.NextProtoTLS, NextProtoDQ)), quicConfig)
if err != nil {
return nil, err
}