Chore: remove unused code
This commit is contained in:
parent
946326aae9
commit
26cdcc22c8
1 changed files with 4 additions and 6 deletions
|
@ -206,12 +206,10 @@ func (spc *ssPacketConn) WriteWithMetadata(p []byte, metadata *C.Metadata) (n in
|
||||||
|
|
||||||
func (spc *ssPacketConn) ReadFrom(b []byte) (int, net.Addr, error) {
|
func (spc *ssPacketConn) ReadFrom(b []byte) (int, net.Addr, error) {
|
||||||
n, _, e := spc.PacketConn.ReadFrom(b)
|
n, _, e := spc.PacketConn.ReadFrom(b)
|
||||||
addr := socks5.SplitAddr(b[:n])
|
if e != nil {
|
||||||
var from net.Addr
|
return 0, nil, e
|
||||||
if e == nil {
|
|
||||||
// Get the source IP/Port of packet.
|
|
||||||
from = addr.UDPAddr()
|
|
||||||
}
|
}
|
||||||
|
addr := socks5.SplitAddr(b[:n])
|
||||||
copy(b, b[len(addr):])
|
copy(b, b[len(addr):])
|
||||||
return n - len(addr), from, e
|
return n - len(addr), addr.UDPAddr(), e
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue