Skip to content

Commit

Permalink
throw exception on write new packet when the watcher of ConcurrentStr…
Browse files Browse the repository at this point in the history
…eam dead with error
  • Loading branch information
bezzad committed Nov 11, 2023
1 parent 69dd514 commit 970f064
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Downloader/ConcurrentStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ public async Task WriteAsync(long position, byte[] bytes, int length)
if (bytes.Length < length)
throw new ArgumentOutOfRangeException(nameof(length));

if(IsFaulted && Exception is not null)
throw Exception;

await _inputBuffer.TryAdd(new Packet(position, bytes, length));
}

Expand Down

0 comments on commit 970f064

Please sign in to comment.