From 638d953b1d461679578d1bdabd57407ac1de2060 Mon Sep 17 00:00:00 2001 From: TapTap Date: Fri, 4 Sep 2026 02:29:06 +0200 Subject: [PATCH] fix: bump protocol version for max alloc wire format --- README.md | 8 ++++---- src/shared/config.h | 2 +- tests/test_config.c | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 63999e8..6bf01d4 100644 --- a/README.md +++ b/README.md @@ -466,11 +466,11 @@ defaults to the current directory. | ## Protocol and Security -FastSync protocol version `2.2.0` is shared by the client and server. The +FastSync protocol version `2.4.0` is shared by the client and server. The current protocol is sender-driven and includes configuration negotiation, -incremental checks, checksums, manifests, keep-alives, abort handling, and -FastSync-native delta messages. Client and server versions must currently -match exactly. +including the maximum allocation limit, incremental checks, checksums, +manifests, keep-alives, abort handling, and FastSync-native delta messages. +Client and server versions must currently match exactly. TLS provides encrypted TCP transport. Supplying `--ca` enables certificate verification; without it, traffic is encrypted but peer identity is not diff --git a/src/shared/config.h b/src/shared/config.h index 29e2698..a90b86a 100644 --- a/src/shared/config.h +++ b/src/shared/config.h @@ -129,7 +129,7 @@ typedef struct Config { char* compress_choice; } Config; -#define PROTOCOL_VERSION "2.3.0" +#define PROTOCOL_VERSION "2.4.0" #define DEFAULT_CHUNK_SIZE (10 * 1024 * 1024) Config* config_create(void); diff --git a/tests/test_config.c b/tests/test_config.c index f31b20f..ae2ec8f 100644 --- a/tests/test_config.c +++ b/tests/test_config.c @@ -193,7 +193,7 @@ static void test_config_send_receive_version_mismatch() { Config* cfg = config_create(); EXPECT_NOT_NULL(cfg); free(cfg->version); - cfg->version = str_dup("2.2.0"); + cfg->version = str_dup("2.3.0"); cfg->send_directory = str_dup("/src"); cfg->receive_root_directory = str_dup("/dst"); @@ -237,6 +237,8 @@ static void test_config_receive_truncated() { /* A valid prefix exercises cleanup after allocated wire strings and a * partially received scalar field. */ EXPECT_TRUE(send_str(p[1], PROTOCOL_VERSION)); + unsigned long long max_alloc = DEFAULT_MAX_ALLOC; + EXPECT_TRUE(send_n_data(p[1], &max_alloc, sizeof(max_alloc))); EXPECT_TRUE(send_str(p[1], "/src")); EXPECT_TRUE(send_str(p[1], "/dst")); EXPECT_TRUE(send_int(p[1], 1));