Skip to content

Commit

Permalink
fix UDP associate
Browse files Browse the repository at this point in the history
Read() simply returns if the buffer is empty.
  • Loading branch information
eycorsican committed Jul 6, 2019
1 parent 50f3276 commit c7fd071
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func tcpLocal(addr, server string, shadow func(net.Conn) net.Conn, getAddr func(

// UDP: keep the connection until disconnect then free the UDP socket
if err == socks.InfoUDPAssociate {
buf := []byte{}
buf := make([]byte, 1)
// block here
for {
_, err := c.Read(buf)
Expand Down

0 comments on commit c7fd071

Please sign in to comment.