ZipOutputStream calls sync DeflaterOutputStream.Finish from async
Christianschrodahl opened this issue · 1 comments
Christianschrodahl commented
Steps to reproduce
- Create http get request.
- set AllowSynchronousIO to false
- Start zip json data and pdf docs
- Only use async methods to run the code.
Expected behavior
Return a zipped file
Actual behavior
You can se it crash on PutNextEntryAsync and/or finnishAsync.
Looks like PutNextEntryAsync calls Finish() and not FinnishAsync()
Exception:
Exception has occurred: CLR/System.InvalidOperationException
Exception thrown: 'System.InvalidOperationException' in System.Private.CoreLib.dll: 'Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead.'
Version of SharpZipLib
1.4.1
Obtained from (only keep the relevant lines)
- Package installed using NuGet
piksel commented
Yeah, this is caused by the following line:
It shouldn't be called inside WriteEntryFooter
, but rather in the CloseEntry(Async) methods.