feat: add delta transfer for incremental sync
CI / build-and-test (push) Successful in 28s
CI / build-and-test (pull_request) Successful in 28s

Implement rsync-style delta transfer using rolling checksums (Adler-32 +
xxHash32). When a file exists on both sides but has changed, only the
changed blocks are transmitted instead of the entire file.

- New status codes: STATUS_DELTA_SIGNATURE, STATUS_DELTA_DATA
- Protocol version bumped to 1.2.0
- Server generates block signature, client computes delta
- Auto-fallback to whole-file when delta >= 70% of file size
- Works with zstd compression on delta stream
- Configurable block size (default 8KB, --delta-block flag)
- 13 unit tests covering hashing, signature roundtrip, delta compute/apply,
  file growth/shrink, and decision logic
This commit is contained in:
2026-07-18 20:00:15 +02:00
parent 43ba149ad5
commit e16db56580
13 changed files with 8628 additions and 19 deletions
+4 -1
View File
@@ -2,6 +2,7 @@
#define CONFIG_H
#include <stdbool.h>
#include <stdint.h>
typedef enum {
TRANSPORT_TCP,
@@ -33,13 +34,15 @@ typedef struct Config {
unsigned long long max_size;
unsigned long long min_size;
bool use_incremental;
bool use_delta;
uint32_t delta_block_size;
bool use_tls;
char *tls_cert;
char *tls_key;
char *tls_ca;
} Config;
#define PROTOCOL_VERSION "1.1.0"
#define PROTOCOL_VERSION "1.2.0"
#define DEFAULT_CHUNK_SIZE (10 * 1024 * 1024)
Config *config_create(char *version, char *send_directory,