From 8cf51a847e94c06c8abca7ee72b3c879cc0f23e2 Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Sat, 6 Mar 2021 13:53:25 +0000 Subject: [PATCH] fix misbehaving code crash and create bug on transport level front proxy --- app/dns/nameserver_doh.go | 2 +- app/dns/nameserver_quic.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/dns/nameserver_doh.go b/app/dns/nameserver_doh.go index cc726ae77..5b471ab65 100644 --- a/app/dns/nameserver_doh.go +++ b/app/dns/nameserver_doh.go @@ -223,7 +223,7 @@ func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, clientIP n go func(r *dnsRequest) { // generate new context for each req, using same context // may cause reqs all aborted if any one encounter an error - dnsCtx := context.Background() + dnsCtx := ctx // reserve internal dns server requested Inbound if inbound := session.InboundFromContext(ctx); inbound != nil { diff --git a/app/dns/nameserver_quic.go b/app/dns/nameserver_quic.go index ba57ff474..f5c391c26 100644 --- a/app/dns/nameserver_quic.go +++ b/app/dns/nameserver_quic.go @@ -169,7 +169,7 @@ func (s *QUICNameServer) sendQuery(ctx context.Context, domain string, clientIP go func(r *dnsRequest) { // generate new context for each req, using same context // may cause reqs all aborted if any one encounter an error - dnsCtx := context.Background() + dnsCtx := ctx // reserve internal dns server requested Inbound if inbound := session.InboundFromContext(ctx); inbound != nil {