Fix WriteTo length
This commit is contained in:
parent
786f71c7f7
commit
17ecf10f79
8
udp.go
8
udp.go
@ -47,7 +47,13 @@ func (s *UDPConn) WriteTo(b []byte, addr net.Addr) (int, error) {
|
||||
|
||||
atyp, host, port := socksAddr.Socks()
|
||||
datagram := NewDatagram(atyp, host, port, b)
|
||||
return s.PacketConn.WriteTo(datagram.Bytes(), s.ServerAddr)
|
||||
|
||||
n, err := s.PacketConn.WriteTo(datagram.Bytes(), s.ServerAddr)
|
||||
if n < 10 {
|
||||
n = 10
|
||||
}
|
||||
|
||||
return n - 10, err
|
||||
}
|
||||
|
||||
func (s *UDPConn) Write(b []byte) (int, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user