If the stream does not support streaming, it shouldn't be reset on failure (e.g. due to folder missing)
This commit is contained in:
@@ -271,9 +271,12 @@ namespace RemoteSynchronization
|
||||
Dispose(); // Dispose current backend and streaming backend.
|
||||
|
||||
// Reset the stream, as it's in a potentially faulty state.
|
||||
stream?.Seek(0, SeekOrigin.Begin);
|
||||
if (resetStream)
|
||||
stream?.SetLength(0);
|
||||
if (stream != null && stream.CanSeek)
|
||||
{
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
if (resetStream)
|
||||
stream.SetLength(0);
|
||||
}
|
||||
|
||||
// Try to see if we can recover from the error.
|
||||
await TryRecoverFromException(ex, token).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user