mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 17:35:40 +08:00
common: remove unnecessary logs
This commit is contained in:
parent
9acaff5b4a
commit
73a778f5e1
@ -5,8 +5,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nadoo/glider/common/log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// UDPBufSize is the size of udp buffer
|
// 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 {
|
func OutboundIP() string {
|
||||||
conn, err := net.Dial("udp", "8.8.8.8:80")
|
conn, err := net.Dial("udp", "8.8.8.8:80")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.F("get outbound ip error: %s", err)
|
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
@ -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 {
|
if len(ips) != 0 {
|
||||||
c.cache.Put(getKey(resp.Question), respBytes, ttl)
|
c.cache.Put(getKey(resp.Question), respBytes, ttl)
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ func (s *HTTP) servHTTPS(method, requestURI, proto string, c net.Conn) {
|
|||||||
return
|
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)
|
log.F("[http] %s <-> %s [c]", c.RemoteAddr(), requestURI)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user