Skip to content

Commit bba25ef

Browse files
authored
Merge pull request #141 from austinvazquez/fix-error-check-in-server
Unwrap IO errors in server connection error handling
2 parents 98b5f64 + 9599fad commit bba25ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ func (c *serverConn) run(sctx context.Context) {
547547
// branch. Basically, it means that we are no longer receiving
548548
// requests due to a terminal error.
549549
recvErr = nil // connection is now "closing"
550-
if err == io.EOF || err == io.ErrUnexpectedEOF || errors.Is(err, syscall.ECONNRESET) {
550+
if errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) || errors.Is(err, syscall.ECONNRESET) {
551551
// The client went away and we should stop processing
552552
// requests, so that the client connection is closed
553553
return

0 commit comments

Comments
 (0)