bug: file_send_sendfile accepts compression_level parameter but ignores it #41
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In src/shared/file.c:436-468, the file_send_sendfile function accepts a compression_level parameter but explicitly ignores it:
This means that using --sendfile with compression silently disables compression. Worse, the CLI validation at client_cli.c:242 checks for this combination:
But in the multithreaded path (client_send.c:145-161), the condition only checks
!config->use_compressionto decide the sendfile path, which is correct. However, the function signature is misleading since it advertises a compression parameter it cannot honor.Fix: Either remove the parameter from the function signature, or implement compression support in the sendfile path using a temporary pipe.
Severity: low