-
Notifications
You must be signed in to change notification settings - Fork 734
Open
Labels
Description
Bug description
Describe the bug
Documentation describes a 0-10 range which is not properly mapped to zstd's range of 1-22. The scaled value is saved to the PcapPlusPlus context but not the zstd compression parameter.
PcapPlusPlus/3rdParty/LightPcapNg/LightPcapNg/src/light_zstd_compression.c
Lines 60 to 61 in d1263a2
| context->compression_level = compression_level * 2; //Input is scale 0-10 but zstd goes 0 - 20! | |
| assert(!ZSTD_isError(ZSTD_CCtx_setParameter(context->cctx, ZSTD_c_compressionLevel, compression_level))); |
Expected behavior
The scaling that gets applied to the context. For reference Technica-Engineering/LightPcapNG uses a slightly different calculation
//Input is scale 0-9 but zstd goes 1-22!
compression_level = (compression_level * 2) + 1;
PcapPlusPlus versions tested on
PcapPlusPlus master branch
Other PcapPlusPlus version (if applicable)
No response
Operating systems tested on
Linux
Other operation systems (if applicable)
No response
Compiler version
GCC 13.3.0
Packet capture backend (if applicable)
libpcap
Reactions are currently unavailable