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

View File

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