This means that regardless of what the user specifies via -c 10 or --archive, the zstd compression context is never configured with ZSTD_CCtx_setParameter() for the compression level. The default zstd level (3) is always used.
Impact
Users requesting lower compression (faster) or higher compression (smaller files) do not get the expected behavior. For example, -c 1 (fastest) and -c 22 (slowest, best ratio) would produce identical results.
Also consider clamping compression_level to valid range (1–22) and validating it earlier in the CLI parsing.
Severity
Critical
Category
Bug
This issue was automatically generated by the issue-creator agent.
## Description
In `src/shared/compression.c` line 10, the `data_compress()` function casts the `compression_level` parameter to void:
```c
Data* data_compress(Data* data_to_compress, int compression_level) {
(void)compression_level; // <-- parameter silently discarded
...
}
```
This means that regardless of what the user specifies via `-c 10` or `--archive`, the zstd compression context is never configured with `ZSTD_CCtx_setParameter()` for the compression level. The default zstd level (3) is always used.
## Impact
Users requesting lower compression (faster) or higher compression (smaller files) do not get the expected behavior. For example, `-c 1` (fastest) and `-c 22` (slowest, best ratio) would produce identical results.
## Location
`src/shared/compression.c:9-43`
## Suggested Fix
After creating the ZSTD compression context, add:
```c
ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, compression_level);
```
Also consider clamping `compression_level` to valid range (1–22) and validating it earlier in the CLI parsing.
## Severity
Critical
## Category
Bug
---
_This issue was automatically generated by the issue-creator agent._
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
In
src/shared/compression.cline 10, thedata_compress()function casts thecompression_levelparameter to void:This means that regardless of what the user specifies via
-c 10or--archive, the zstd compression context is never configured withZSTD_CCtx_setParameter()for the compression level. The default zstd level (3) is always used.Impact
Users requesting lower compression (faster) or higher compression (smaller files) do not get the expected behavior. For example,
-c 1(fastest) and-c 22(slowest, best ratio) would produce identical results.Location
src/shared/compression.c:9-43Suggested Fix
After creating the ZSTD compression context, add:
Also consider clamping
compression_levelto valid range (1–22) and validating it earlier in the CLI parsing.Severity
Critical
Category
Bug
This issue was automatically generated by the issue-creator agent.