Skip to content

Commit

Permalink
Handle the EOF case and stop reading from the connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Jan 23, 2025
1 parent 64c48ce commit a62e0b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ func (h *associationHandler) HandleAssociation(ctx context.Context, clientConn n
default:
}
clientProxyBytes, err := clientConn.Read(readBuf)
if errors.Is(err, net.ErrClosed) {
if errors.Is(err, net.ErrClosed) || errors.Is(err, io.EOF) {
debugUDP(l, "Client closed connection")
break
}
pkt := readBuf[:clientProxyBytes]
Expand Down

0 comments on commit a62e0b6

Please sign in to comment.