From 78867aa69ce00b8deef8fe538e20de2e981dffd0 Mon Sep 17 00:00:00 2001 From: nurhafiz Date: Thu, 12 Oct 2023 07:25:36 +0800 Subject: [PATCH] Fix #6 Replacing GZipStream with SharpZipLib's GZipInputStream fixes the issue without requiring any other code modification. The root cause is unknown for now. --- src/Toimik.WarcProtocol/CompressionStreamFactory.cs | 7 ++----- src/Toimik.WarcProtocol/Toimik.WarcProtocol.csproj | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Toimik.WarcProtocol/CompressionStreamFactory.cs b/src/Toimik.WarcProtocol/CompressionStreamFactory.cs index a7e1d6a..c8c29ad 100644 --- a/src/Toimik.WarcProtocol/CompressionStreamFactory.cs +++ b/src/Toimik.WarcProtocol/CompressionStreamFactory.cs @@ -16,8 +16,8 @@ namespace Toimik.WarcProtocol; +using ICSharpCode.SharpZipLib.GZip; using System.IO; -using System.IO.Compression; public class CompressionStreamFactory { @@ -27,9 +27,6 @@ public CompressionStreamFactory() public virtual Stream CreateDecompressStream(Stream stream) { - return new GZipStream( - stream, - CompressionMode.Decompress, - leaveOpen: true); + return new GZipInputStream(stream); } } \ No newline at end of file diff --git a/src/Toimik.WarcProtocol/Toimik.WarcProtocol.csproj b/src/Toimik.WarcProtocol/Toimik.WarcProtocol.csproj index 02fe8cc..e191ddc 100644 --- a/src/Toimik.WarcProtocol/Toimik.WarcProtocol.csproj +++ b/src/Toimik.WarcProtocol/Toimik.WarcProtocol.csproj @@ -24,6 +24,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive