socks5: fixed a bug in ReadFrom

This commit is contained in:
nadoo 2018-01-22 00:51:28 +08:00
parent 0d9f588e1f
commit 24d30cdca7

View File

@ -644,7 +644,7 @@ func (pc *Socks5PktConn) ReadFrom(b []byte) (int, net.Addr, error) {
pc.tgtAddr = tgtAddr
}
return n - len(tgtAddr), raddr, err
return n - len(tgtAddr) - 3, raddr, err
}
// WriteTo overrides the original function from net.PacketConn