Skip to content

Commit

Permalink
request-server: don't return EOF if there is an unexpected error
Browse files Browse the repository at this point in the history
io.EOF means no error so convert to ErrUnexpectedEOF if we detect
a transfer error
  • Loading branch information
drakkan committed Nov 5, 2020
1 parent 796f65a commit 27d77fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions request-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ func (rs *RequestServer) Serve() error {
// (eg. possible on dropped connections, client crashes, etc.)
for handle, req := range rs.openRequests {
req.transferError(err)
if err == io.EOF {
err = io.ErrUnexpectedEOF
}

delete(rs.openRequests, handle)
req.close()
Expand Down

0 comments on commit 27d77fe

Please sign in to comment.