From 575c7a9687946365199cda7f0b6777ee8b344b4c Mon Sep 17 00:00:00 2001 From: Arthur Morgan <4637240+badO1a5A90@users.noreply.github.com> Date: Wed, 13 Oct 2021 00:49:31 +0800 Subject: [PATCH] adjust --- app/dns/dohdns.go | 4 ++-- app/dns/udpns.go | 4 ++-- transport/internet/dialer.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/dns/dohdns.go b/app/dns/dohdns.go index f5ea92e3..6719428f 100644 --- a/app/dns/dohdns.go +++ b/app/dns/dohdns.go @@ -370,7 +370,7 @@ func (s *DoHNameServer) QueryIP(ctx context.Context, domain string, option dns_f ips, err := s.findIPsForDomain(fqdn, option) if err != errRecordNotFound { newError(s.name, " cache HIT ", domain, " -> ", ips).Base(err).AtDebug().WriteToLog() - log.Record(&log.DNSLog{s.name, domain, ips, log.DNSCacheHit, 0, err}) + log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSCacheHit, Elapsed: 0, Error: err}) return ips, err } @@ -406,7 +406,7 @@ func (s *DoHNameServer) QueryIP(ctx context.Context, domain string, option dns_f for { ips, err := s.findIPsForDomain(fqdn, option) if err != errRecordNotFound { - log.Record(&log.DNSLog{s.name, domain, ips, log.DNSQueried, time.Since(start), err}) + log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSQueried, Elapsed: time.Since(start), Error: err}) return ips, err } diff --git a/app/dns/udpns.go b/app/dns/udpns.go index cb4cffe5..c32fe593 100644 --- a/app/dns/udpns.go +++ b/app/dns/udpns.go @@ -251,7 +251,7 @@ func (s *ClassicNameServer) QueryIP(ctx context.Context, domain string, option d ips, err := s.findIPsForDomain(fqdn, option) if err != errRecordNotFound { newError(s.name, " cache HIT ", domain, " -> ", ips).Base(err).AtDebug().WriteToLog() - log.Record(&log.DNSLog{s.name, domain, ips, log.DNSCacheHit, 0, err}) + log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSCacheHit, Elapsed: 0, Error: err}) return ips, err } @@ -287,7 +287,7 @@ func (s *ClassicNameServer) QueryIP(ctx context.Context, domain string, option d for { ips, err := s.findIPsForDomain(fqdn, option) if err != errRecordNotFound { - log.Record(&log.DNSLog{s.name, domain, ips, log.DNSQueried, time.Since(start), err}) + log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSQueried, Elapsed: time.Since(start), Error: err}) return ips, err } diff --git a/transport/internet/dialer.go b/transport/internet/dialer.go index fda06a52..7ba1f285 100644 --- a/transport/internet/dialer.go +++ b/transport/internet/dialer.go @@ -117,12 +117,12 @@ func canLookupIP(ctx context.Context, dst net.Destination, sockopt *SocketConfig func redirect(ctx context.Context, dst net.Destination, obt string) net.Conn { newError("redirecting request " + dst.String() + " to " + obt).WriteToLog(session.ExportIDToError(ctx)) h := obm.GetHandler(obt) - ctx = session.ContextWithOutbound(ctx, &session.Outbound{dst, nil}) + ctx = session.ContextWithOutbound(ctx, &session.Outbound{Target: dst, Gateway: nil}) if h != nil { ur, uw := pipe.New(pipe.OptionsFromContext(ctx)...) dr, dw := pipe.New(pipe.OptionsFromContext(ctx)...) - go h.Dispatch(ctx, &transport.Link{ur, dw}) + go h.Dispatch(ctx, &transport.Link{Reader: ur, Writer: dw}) nc := cnc.NewConnection( cnc.ConnectionInputMulti(uw), cnc.ConnectionOutputMulti(dr),