mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 13:41:23 +08:00
Chore: remove unused code
This commit is contained in:
parent
f3f8e7e52f
commit
0f4cdbf187
@ -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)
|
||||||
|
if e != nil {
|
||||||
|
return 0, nil, e
|
||||||
|
}
|
||||||
addr := socks5.SplitAddr(b[:n])
|
addr := socks5.SplitAddr(b[:n])
|
||||||
var from net.Addr
|
|
||||||
if e == nil {
|
|
||||||
// Get the source IP/Port of packet.
|
|
||||||
from = addr.UDPAddr()
|
|
||||||
}
|
|
||||||
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 New Issue
Block a user