Skip to content

Commit

Permalink
turn off native gzip
Browse files Browse the repository at this point in the history
  • Loading branch information
aloneguid committed Sep 30, 2024
1 parent ceee0ae commit 25c4405
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: '🏦 Build'

env:
VERSION: 1.6.1
# PACKAGE_SUFFIX: '-pre.1'
PACKAGE_SUFFIX: ''
VERSION: 1.6.2
PACKAGE_SUFFIX: '-pre.1'
# PACKAGE_SUFFIX: ''
ASM_VERSION: 1.0.0
BUILD_TYPE: Release
VCPKG_HASH: 0f88ecb8528605f91980b90a2c5bad88e3cb565f
Expand Down
12 changes: 8 additions & 4 deletions native/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ bool compress_zstd(
#endif

// zlib tutorial: https://bobobobo.wordpress.com/2008/02/23/how-to-use-zlib/
bool compress_gzip(
// gzip is NOT zlib
/*bool compress_gzip(
bool compress,
char* input_buffer,
int input_buffer_size,
Expand Down Expand Up @@ -153,7 +154,7 @@ bool compress_gzip(
}
return false;
}
}*/

bool compress_brotli(
bool compress,
Expand Down Expand Up @@ -314,8 +315,8 @@ bool iron_compress(bool compress, int32_t codec, char* input_buffer, int32_t inp
case 2:
return compress_zstd(compress, input_buffer, input_buffer_size, output_buffer, output_buffer_size, compression_level);
#endif
case 3:
return compress_gzip(compress, input_buffer, input_buffer_size, output_buffer, output_buffer_size, compression_level);
//case 3:
// return compress_gzip(compress, input_buffer, input_buffer_size, output_buffer, output_buffer_size, compression_level);
case 4:
return compress_brotli(compress, input_buffer, input_buffer_size, output_buffer, output_buffer_size, compression_level);
case 5:
Expand All @@ -328,6 +329,9 @@ bool iron_compress(bool compress, int32_t codec, char* input_buffer, int32_t inp
}

bool iron_is_supported(compression_codec codec) {

if(codec == compression_codec::gzip) return false;

#ifdef NO_NATIVE_SNAPPY
if(codec == compression_codec::snappy) return false;
#endif
Expand Down
7 changes: 4 additions & 3 deletions native/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ TEST(Roundtrip, Zstd_2) {
EXPECT_TRUE(run(2, bytes, 3));
}

TEST(Roundtrip, Zlib_3) {
char bytes[] = {'a', 'b', 'c'};
EXPECT_TRUE(run(3, bytes, 3));
TEST(Roundtrip, Gzip_3) {
EXPECT_FALSE(iron_is_supported(compression_codec::gzip));
//char bytes[] = {'a', 'b', 'c'};
//EXPECT_TRUE(run(3, bytes, 3));
}

TEST(Roundtrip, Brotli_4) {
Expand Down

0 comments on commit 25c4405

Please sign in to comment.