From 9c9fec9011268344de029ac5c93eef47eb240a16 Mon Sep 17 00:00:00 2001 From: nurhafiz Date: Thu, 12 Oct 2023 07:37:24 +0800 Subject: [PATCH] Fix #6 Replacing GZipStream with SharpZipLib's GZipInputStream fixes the issue without requiring any other code modification. The root cause is yet unknown. --- src/Toimik.WarcProtocol/CompressionStreamFactory.cs | 7 ++----- src/Toimik.WarcProtocol/Toimik.WarcProtocol.csproj | 5 +++-- .../Toimik.WarcProtocol.Tests.csproj | 12 ++++++------ 3 files changed, 11 insertions(+), 13 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..50e29dd 100644 --- a/src/Toimik.WarcProtocol/Toimik.WarcProtocol.csproj +++ b/src/Toimik.WarcProtocol/Toimik.WarcProtocol.csproj @@ -4,9 +4,9 @@ net6.0 enable Toimik.WarcProtocol - 0.8.0 + 0.9.0 Nurhafiz - 0.8.0 + 0.9.0 true Toimik @@ -24,6 +24,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Toimik.WarcProtocol.Tests/Toimik.WarcProtocol.Tests.csproj b/tests/Toimik.WarcProtocol.Tests/Toimik.WarcProtocol.Tests.csproj index b85e667..87ee978 100644 --- a/tests/Toimik.WarcProtocol.Tests/Toimik.WarcProtocol.Tests.csproj +++ b/tests/Toimik.WarcProtocol.Tests/Toimik.WarcProtocol.Tests.csproj @@ -7,23 +7,23 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all