From b6532b1f0f57e51bcdf16e29b251830bac66afcb Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Sat, 10 Aug 2019 20:14:24 +0800 Subject: [PATCH] Fix: crash in handleConn --- tunnel/tunnel.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tunnel/tunnel.go b/tunnel/tunnel.go index 59368615..8681e5c2 100644 --- a/tunnel/tunnel.go +++ b/tunnel/tunnel.go @@ -165,7 +165,7 @@ func (t *Tunnel) handleUDPConn(localConn C.ServerAdapter, metadata *C.Metadata, addr = naddr pc = rawpc if err != nil { - log.Warnln("%s --> %v match %s using %s error: %s", metadata.SrcIP.String(), metadata.String(), rule.RuleType().String(), rule.Adapter(), err.Error()) + log.Warnln("dial %s error: %s", proxy.Name(), err.Error()) return } @@ -184,9 +184,8 @@ func (t *Tunnel) handleUDPConn(localConn C.ServerAdapter, metadata *C.Metadata, func (t *Tunnel) handleTCPConn(localConn C.ServerAdapter, metadata *C.Metadata, proxy C.Proxy, rule C.Rule) { remoConn, err := proxy.Dial(metadata) - if err != nil { - log.Warnln("%s --> %v match %s using %s error: %s", metadata.SrcIP.String(), metadata.String(), rule.RuleType().String(), rule.Adapter(), err.Error()) + log.Warnln("dial %s error: %s", proxy.Name(), err.Error()) return } defer remoConn.Close()