more detail log

This commit is contained in:
rui.zheng 2015-10-30 13:51:56 +08:00
parent 1012043aaa
commit d3fe7c74eb
2 changed files with 6 additions and 3 deletions

View File

@ -144,14 +144,14 @@ func handleConn(conn net.Conn, arg Args) {
method := selector.Select(methods...)
if _, err := conn.Write([]byte{gosocks5.Ver5, method}); err != nil {
if glog.V(LWARNING) {
glog.Warningln("socks5:", err)
glog.Warningln("socks5 select:", err)
}
return
}
c, err := selector.OnSelected(method, conn)
if err != nil {
if glog.V(LWARNING) {
glog.Warningln("socks5:", err)
glog.Warningln("socks5 onselected:", err)
}
return
}
@ -160,7 +160,7 @@ func handleConn(conn net.Conn, arg Args) {
req, err := gosocks5.ReadRequest(conn)
if err != nil {
if glog.V(LWARNING) {
glog.Warningln("socks5:", err)
glog.Warningln("socks5 request:", err)
}
return
}

View File

@ -409,8 +409,10 @@ func createClientConn(conn net.Conn, uconn *net.UDPConn) (c *UDPConn, dgram *gos
select {
case dgram = <-dgramChan:
if raddr != nil {
glog.V(LINFO).Infoln("[udp] client", raddr)
c = Client(uconn, raddr)
} else {
glog.V(LINFO).Infoln("[udp] tunnel")
c = Client(conn, nil)
}
case err = <-errChan:
@ -451,6 +453,7 @@ func createServerConn(uconn *net.UDPConn, addr net.Addr) (c *UDPConn, err error)
fconn.Close()
return nil, errors.New("Failure")
}
glog.V(LINFO).Infoln("forward udp associate, on", rep.Addr, "OK")
c = Server(fconn)
return