Skip to content

Commit adf5a8d

Browse files
authored
deps: bump up zlib-ng to v2.2.4 (envoyproxy#39251)
This PR bumps up the version of `zlib-ng` to v2.2.4. Signed-off-by: Rohit Agrawal <[email protected]>
1 parent e7da43c commit adf5a8d

File tree

5 files changed

+19
-41
lines changed

5 files changed

+19
-41
lines changed

bazel/foreign_cc/zlib_ng.patch

Lines changed: 0 additions & 32 deletions
This file was deleted.

bazel/repositories.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,6 @@ def _com_github_zlib_ng_zlib_ng():
441441
external_http_archive(
442442
name = "com_github_zlib_ng_zlib_ng",
443443
build_file_content = BUILD_ALL_CONTENT,
444-
patch_args = ["-p1"],
445-
patches = ["@envoy//bazel/foreign_cc:zlib_ng.patch"],
446444
)
447445

448446
# Boost in general is not approved for Envoy use, and the header-only

bazel/repository_locations.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,12 +800,12 @@ REPOSITORY_LOCATIONS_SPEC = dict(
800800
project_name = "zlib-ng",
801801
project_desc = "zlib fork (higher performance)",
802802
project_url = "https://github.com/zlib-ng/zlib-ng",
803-
version = "2.0.7",
804-
sha256 = "6c0853bb27738b811f2b4d4af095323c3d5ce36ceed6b50e5f773204fb8f7200",
803+
version = "2.2.4",
804+
sha256 = "a73343c3093e5cdc50d9377997c3815b878fd110bf6511c2c7759f2afb90f5a3",
805805
strip_prefix = "zlib-ng-{version}",
806806
urls = ["https://github.com/zlib-ng/zlib-ng/archive/{version}.tar.gz"],
807807
use_category = ["controlplane", "dataplane_core"],
808-
release_date = "2023-03-17",
808+
release_date = "2025-02-10",
809809
cpe = "N/A",
810810
license = "zlib",
811811
license_url = "https://github.com/zlib-ng/zlib-ng/blob/{version}/LICENSE.md",

test/extensions/compression/gzip/compressor/zlib_compressor_impl_test.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ TEST_F(ZlibCompressorImplTest, CallingChecksum) {
185185
compressor.compressThenFlush(buffer);
186186
expectValidFlushedBuffer(buffer);
187187

188+
// Add an empty buffer finish call to finalize the checksum
189+
Buffer::OwnedImpl empty_buffer;
190+
compressor.finish(empty_buffer);
191+
188192
drainBuffer(buffer);
189193
EXPECT_TRUE(compressor.checksum() > 0);
190194
}

test/extensions/compression/gzip/decompressor/zlib_decompressor_impl_test.cc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,14 @@ TEST_F(ZlibDecompressorImplTest, CallingChecksum) {
104104
gzip_window_bits, memory_level);
105105
ASSERT_EQ(0, compressor.checksum());
106106

107+
// Create test data
107108
TestUtility::feedBufferWithRandomCharacters(compressor_buffer, 4096);
108-
compressor.compress(compressor_buffer, Envoy::Compression::Compressor::State::Flush);
109+
110+
// Make a copy of the original data
111+
std::string original_data = compressor_buffer.toString();
112+
113+
// Use Finish instead of Flush to ensure complete gzip data with checksum
114+
compressor.compress(compressor_buffer, Envoy::Compression::Compressor::State::Finish);
109115
ASSERT_TRUE(compressor.checksum() > 0);
110116

111117
ZlibDecompressorImpl decompressor{stats_scope_, "test.", 4096, 100};
@@ -114,11 +120,13 @@ TEST_F(ZlibDecompressorImplTest, CallingChecksum) {
114120

115121
decompressor.decompress(compressor_buffer, decompressor_output_buffer);
116122

117-
drainBuffer(compressor_buffer);
118-
drainBuffer(decompressor_output_buffer);
119-
123+
// Verify checksum match and is non-zero
124+
EXPECT_TRUE(decompressor.checksum() > 0);
120125
EXPECT_EQ(compressor.checksum(), decompressor.checksum());
121126
ASSERT_EQ(0, decompressor.decompression_error_);
127+
128+
// Verify content matches original
129+
EXPECT_EQ(original_data, decompressor_output_buffer.toString());
122130
}
123131

124132
// Detect excessive compression ratio by compressing a long whitespace string

0 commit comments

Comments
 (0)