Merge pull request #38 from masters-of-cats/pr-client-eof-improvement
Improve connection error handling
This commit is contained in:
commit
f82148331a
@ -449,14 +449,14 @@ func (c *serverConn) run(sctx context.Context) {
|
|||||||
// branch. Basically, it means that we are no longer receiving
|
// branch. Basically, it means that we are no longer receiving
|
||||||
// requests due to a terminal error.
|
// requests due to a terminal error.
|
||||||
recvErr = nil // connection is now "closing"
|
recvErr = nil // connection is now "closing"
|
||||||
if err != nil && err != io.EOF {
|
|
||||||
logrus.WithError(err).Error("error receiving message")
|
|
||||||
}
|
|
||||||
if err == io.EOF || err == io.ErrUnexpectedEOF {
|
if err == io.EOF || err == io.ErrUnexpectedEOF {
|
||||||
// The client went away and we should stop processing
|
// The client went away and we should stop processing
|
||||||
// requests, so that the client connection is closed
|
// requests, so that the client connection is closed
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
|
logrus.WithError(err).Error("error receiving message")
|
||||||
|
}
|
||||||
case <-shutdown:
|
case <-shutdown:
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user