common: remove unnecessary logs

This commit is contained in:
nadoo 2018-08-02 13:02:04 +08:00
parent 9acaff5b4a
commit 73a778f5e1
3 changed files with 2 additions and 5 deletions

View File

@ -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()

View File

@ -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)
}

View File

@ -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)