fix: address PR review - rolling adler32, extract helpers, configurable max file size
CI / build-and-test (push) Successful in 29s
CI / build-and-test (pull_request) Successful in 28s

- Fix rolling adler32: add missing -1 in s2 update formula (was producing
  wrong checksums, causing zero block matches)
- Fix file_send_sendfile signature to match typedef (add unused
  compression_level param)
- Extract receive_delta_file() from receive_incremental_check() to reduce
  nesting depth
- Extract send_file_incremental() helper in client_send.c
- Add delta_max_file_size to Config, serialized over wire
- Add --delta-max CLI flag
- Add test_large_file_delta (200KB) and extra delta_should_attempt cases
- Remove unused pos_in_block variable from delta_compute
This commit is contained in:
2026-07-19 02:02:28 +02:00
parent e16db56580
commit 598e4e7514
9 changed files with 339 additions and 261 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ void *delta_apply(const void *old_data, uint64_t old_size, const Delta *delta,
uint32_t block_size);
void delta_destroy(Delta *delta);
bool delta_should_attempt(uint64_t old_size, uint64_t new_size);
bool delta_should_attempt(uint64_t old_size, uint64_t new_size, uint64_t max_file_size);
bool delta_is_worthwhile(const Delta *delta, uint64_t new_file_size);
uint32_t delta_adler32(const void *data, uint32_t len);