Browse Source

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

Shelikhoo 4 years ago
parent
commit
dbfc2138e4
1 changed files with 1 additions and 3 deletions
  1. 1 3
      app/dns/nameserver_quic.go

+ 1 - 3
app/dns/nameserver_quic.go

@@ -9,8 +9,6 @@ import (
 	"sync/atomic"
 	"sync/atomic"
 	"time"
 	"time"
 
 
-	core "github.com/v2fly/v2ray-core/v4"
-
 	"github.com/lucas-clemente/quic-go"
 	"github.com/lucas-clemente/quic-go"
 	"golang.org/x/net/dns/dnsmessage"
 	"golang.org/x/net/dns/dnsmessage"
 	"golang.org/x/net/http2"
 	"golang.org/x/net/http2"
@@ -372,7 +370,7 @@ func (s *QUICNameServer) openSession(ctx context.Context) (quic.Session, error)
 		HandshakeIdleTimeout: handshakeIdleTimeout,
 		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 {
 	if err != nil {
 		return nil, err
 		return nil, err
 	}
 	}