From 73a778f5e1343e552f8f467d082d07f999beca8a Mon Sep 17 00:00:00 2001 From: nadoo <287492+nadoo@users.noreply.github.com> Date: Thu, 2 Aug 2018 13:02:04 +0800 Subject: [PATCH] common: remove unnecessary logs --- common/conn/conn.go | 3 --- dns/client.go | 2 +- proxy/http/http.go | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/common/conn/conn.go b/common/conn/conn.go index 34ff05d..3c10721 100644 --- a/common/conn/conn.go +++ b/common/conn/conn.go @@ -5,8 +5,6 @@ import ( "io" "net" "time" - - "github.com/nadoo/glider/common/log" ) // UDPBufSize is the size of udp buffer @@ -85,7 +83,6 @@ func TimedCopy(dst net.PacketConn, target net.Addr, src net.PacketConn, timeout func OutboundIP() string { conn, err := net.Dial("udp", "8.8.8.8:80") if err != nil { - log.F("get outbound ip error: %s", err) return "" } defer conn.Close() diff --git a/dns/client.go b/dns/client.go index 6780549..7f633f9 100644 --- a/dns/client.go +++ b/dns/client.go @@ -90,7 +90,7 @@ func (c *Client) Exchange(reqBytes []byte, clientAddr string, preferTCP bool) ([ } } - // add to cache + // add to cache only when there's a valid ip address if len(ips) != 0 { c.cache.Put(getKey(resp.Question), respBytes, ttl) } diff --git a/proxy/http/http.go b/proxy/http/http.go index 99c4596..f2af98c 100644 --- a/proxy/http/http.go +++ b/proxy/http/http.go @@ -195,7 +195,7 @@ func (s *HTTP) servHTTPS(method, requestURI, proto string, c net.Conn) { return } - c.Write([]byte("HTTP/1.0 200 Connection established\r\n\r\n")) + c.Write([]byte("HTTP/1.1 200 Connection established\r\n\r\n")) log.F("[http] %s <-> %s [c]", c.RemoteAddr(), requestURI)