fix: review fixes — test cleanup, wire protocol, clang-format
CI / lint (pull_request) Failing after 8s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (undefined) (pull_request) Has been skipped
CI / fuzz-build (pull_request) Has been skipped
CI / coverage (pull_request) Has been skipped
CI / valgrind (pull_request) Has been skipped

This commit is contained in:
2026-07-20 20:11:01 +02:00
parent e5b46bb1c0
commit 62ff1d3929
6 changed files with 50 additions and 26 deletions
+21
View File
@@ -118,6 +118,11 @@ bool file_send_single_calls(File* file, int file_descriptor, bool use_metadata,
data_destroy(compressed_data);
return false;
}
int ft = 0; // FILE_TYPE_REGULAR
if (!send_int(file_descriptor, ft)) {
data_destroy(compressed_data);
return false;
}
if (!send_data(file_descriptor, data_to_send)) {
data_destroy(compressed_data);
return false;
@@ -385,6 +390,13 @@ File* receive_incremental_check(int fd, const Config* config, bool* skipped) {
}
}
int file_type;
if (!receive_int(fd, &file_type)) {
file_destroy(file);
send_status(fd, STATUS_ERROR);
return NULL;
}
Data* file_data = receive_data(fd);
if (file_data == NULL) {
file_destroy(file);
@@ -462,6 +474,10 @@ bool file_send_sendfile(File* file, int file_descriptor, bool use_metadata, int
if (use_metadata && !metadata_send(file_descriptor, file->metadata))
return false;
int ft = 0; // FILE_TYPE_REGULAR
if (!send_int(file_descriptor, ft))
return false;
int fd = open(file->path, O_RDONLY);
if (fd == -1) {
perror("Could not open file for sendfile");
@@ -504,6 +520,11 @@ File* file_receive(const Config* config, int file_descriptor) {
return NULL;
}
}
int file_type;
if (!receive_int(file_descriptor, &file_type)) {
file_destroy(file);
return NULL;
}
Data* file_data = receive_data(file_descriptor);
if (file_data == NULL) {
file_destroy(file);