mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-09 13:59:54 +00:00
chore: remove useless laddr from ListenUDP
This commit is contained in:
parent
841810d6ca
commit
858d36cf30
@ -264,7 +264,7 @@ func (c *serverClient) handleTCP(stream quic.Stream, host string, port uint16) {
|
||||
|
||||
func (c *serverClient) handleUDP(stream quic.Stream) {
|
||||
// Like in SOCKS5, the stream here is only used to maintain the UDP session. No need to read anything from it
|
||||
conn, err := c.Transport.ListenUDP(nil)
|
||||
conn, err := c.Transport.ListenUDP()
|
||||
if err != nil {
|
||||
_ = struc.Pack(stream, &serverResponse{
|
||||
OK: false,
|
||||
|
@ -264,7 +264,7 @@ func (s *Server) handleUDP(c *net.TCPConn, r *socks5.Request) error {
|
||||
// Local UDP relay conn for ACL Direct
|
||||
var localRelayConn *net.UDPConn
|
||||
if s.ACLEngine != nil {
|
||||
localRelayConn, err = s.Transport.ListenUDP(nil)
|
||||
localRelayConn, err = s.Transport.ListenUDP()
|
||||
if err != nil {
|
||||
_ = sendReply(c, socks5.RepServerFailure)
|
||||
closeErr = err
|
||||
|
@ -91,6 +91,6 @@ func (ct *ClientTransport) DialTCP(raddr *net.TCPAddr) (*net.TCPConn, error) {
|
||||
return conn.(*net.TCPConn), nil
|
||||
}
|
||||
|
||||
func (ct *ClientTransport) ListenUDP(laddr *net.UDPAddr) (*net.UDPConn, error) {
|
||||
return net.ListenUDP("udp", laddr)
|
||||
func (ct *ClientTransport) ListenUDP() (*net.UDPConn, error) {
|
||||
return net.ListenUDP("udp", nil)
|
||||
}
|
||||
|
@ -100,6 +100,6 @@ func (ct *ServerTransport) DialTCP(raddr *net.TCPAddr) (*net.TCPConn, error) {
|
||||
return conn.(*net.TCPConn), nil
|
||||
}
|
||||
|
||||
func (ct *ServerTransport) ListenUDP(laddr *net.UDPAddr) (*net.UDPConn, error) {
|
||||
return net.ListenUDP("udp", laddr)
|
||||
func (ct *ServerTransport) ListenUDP() (*net.UDPConn, error) {
|
||||
return net.ListenUDP("udp", nil)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user