operations: make reopen code error on NoLowLevelRetry errors - fixes #3777

This commit is contained in:
Nick Craig-Wood 2019-12-02 16:04:03 +00:00
parent 684dbe0e9d
commit 4537d9b5cf

View File

@ -7,6 +7,7 @@ import (
"github.com/pkg/errors"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/fserrors"
)
// reOpen is a wrapper for an object reader which reopens the stream on error
@ -104,7 +105,7 @@ func (h *reOpen) Read(p []byte) (n int, err error) {
h.err = err
}
h.read += int64(n)
if err != nil && err != io.EOF {
if err != nil && err != io.EOF && !fserrors.IsNoLowLevelRetryError(err) {
// close underlying stream
h.opened = false
_ = h.rc.Close()