mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-04 12:27:37 +03:00
Minor fixes
This commit is contained in:
parent
6d16497f03
commit
6a0987c52a
5 changed files with 20 additions and 9 deletions
|
@ -202,7 +202,8 @@ func HandleConnection0(ctx context.Context, conn net.Conn, version byte, authent
|
|||
metadata.Destination = request.Destination
|
||||
return handler.NewConnection(ctx, conn, metadata)
|
||||
case socks5.CommandUDPAssociate:
|
||||
udpConn, err := net.ListenUDP(M.NetworkFromNetAddr("udp", M.AddrFromNetAddr(conn.LocalAddr())), net.UDPAddrFromAddrPort(netip.AddrPortFrom(M.AddrFromNetAddr(conn.LocalAddr()), 0)))
|
||||
var udpConn *net.UDPConn
|
||||
udpConn, err = net.ListenUDP(M.NetworkFromNetAddr("udp", M.AddrFromNetAddr(conn.LocalAddr())), net.UDPAddrFromAddrPort(netip.AddrPortFrom(M.AddrFromNetAddr(conn.LocalAddr()), 0)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -224,7 +225,7 @@ func HandleConnection0(ctx context.Context, conn net.Conn, version byte, authent
|
|||
close(done)
|
||||
}()
|
||||
err = common.Error(io.Copy(io.Discard, conn))
|
||||
return E.New(innerError, err)
|
||||
return E.Errors(innerError, err)
|
||||
default:
|
||||
err = socks5.WriteResponse(conn, socks5.Response{
|
||||
ReplyCode: socks5.ReplyCodeUnsupported,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue