mirror of https://github.com/pkg/sftp.git
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:
parent
c30c93e44e
commit
6af3f0a271
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue