fix: complete ignore-times incremental handling
CI / lint (pull_request) Successful in 11s
CI / sanitizers (address) (pull_request) Successful in 37s
CI / sanitizers (undefined) (pull_request) Successful in 36s
CI / fuzz-build (pull_request) Successful in 15s
CI / coverage (pull_request) Successful in 32s
CI / build-and-test (pull_request) Successful in 1m15s
CI / valgrind (pull_request) Successful in 33s
CI / lint (pull_request) Successful in 11s
CI / sanitizers (address) (pull_request) Successful in 37s
CI / sanitizers (undefined) (pull_request) Successful in 36s
CI / fuzz-build (pull_request) Successful in 15s
CI / coverage (pull_request) Successful in 32s
CI / build-and-test (pull_request) Successful in 1m15s
CI / valgrind (pull_request) Successful in 33s
This commit is contained in:
+1
-1
@@ -129,7 +129,7 @@ typedef struct Config {
|
|||||||
char* compress_choice;
|
char* compress_choice;
|
||||||
} Config;
|
} Config;
|
||||||
|
|
||||||
#define PROTOCOL_VERSION "2.2.0"
|
#define PROTOCOL_VERSION "2.3.0"
|
||||||
#define DEFAULT_CHUNK_SIZE (10 * 1024 * 1024)
|
#define DEFAULT_CHUNK_SIZE (10 * 1024 * 1024)
|
||||||
|
|
||||||
Config* config_create(void);
|
Config* config_create(void);
|
||||||
|
|||||||
@@ -375,7 +375,8 @@ File* receive_incremental_check(int fd, const Config* config, bool* skipped) {
|
|||||||
close(old_fd);
|
close(old_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool match = has_old_file && (unsigned long long)st.st_size == check_size;
|
bool match =
|
||||||
|
!config->ignore_times && has_old_file && (unsigned long long)st.st_size == check_size;
|
||||||
if (match && config->checksum) {
|
if (match && config->checksum) {
|
||||||
uint64_t old_checksum = old_size == 0 ? delta_xxhash64("", 0) : 0;
|
uint64_t old_checksum = old_size == 0 ? delta_xxhash64("", 0) : 0;
|
||||||
if (old_data)
|
if (old_data)
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ class TestIncremental:
|
|||||||
received_file = os.path.join(received, "small.txt")
|
received_file = os.path.join(received, "small.txt")
|
||||||
source_stat = os.stat(source_file)
|
source_stat = os.stat(source_file)
|
||||||
with open(received_file, "wb") as f:
|
with open(received_file, "wb") as f:
|
||||||
f.write(b"stale data\n")
|
f.write(b"stale data!\n")
|
||||||
os.utime(received_file, (source_stat.st_atime, source_stat.st_mtime))
|
os.utime(received_file, (source_stat.st_atime, source_stat.st_mtime))
|
||||||
|
|
||||||
result, _ = run_client(SOURCE_DIR, DEST_DIR,
|
result, _ = run_client(SOURCE_DIR, DEST_DIR,
|
||||||
|
|||||||
Reference in New Issue
Block a user