request-server: don't return EOF if there is an unexpected error

io.EOF means no error so convert to ErrUnexpectedEOF if we detect
a transfer error
This commit is contained in:
Nicola Murino 2020-11-05 13:52:28 +01:00
parent c30c93e44e
commit 6af3f0a271
1 changed files with 3 additions and 0 deletions

View File

@ -167,6 +167,9 @@ func (rs *RequestServer) Serve() error {
// make sure all open requests are properly closed
// (eg. possible on dropped connections, client crashes, etc.)
for handle, req := range rs.openRequests {
if err == io.EOF {
err = io.ErrUnexpectedEOF
}
req.transferError(err)
delete(rs.openRequests, handle)