From dbfc2138e40ecaa5b594191ffb85899dc2fe99c3 Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Wed, 28 Apr 2021 16:44:01 +0100 Subject: [PATCH] fix: make sure the ctx is propagated to connections by detached connection for udp dns --- app/dns/nameserver_quic.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/dns/nameserver_quic.go b/app/dns/nameserver_quic.go index c55fde3f3..7854a5a3e 100644 --- a/app/dns/nameserver_quic.go +++ b/app/dns/nameserver_quic.go @@ -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 }