feat: protocol improvements (#100-#102, #106)
CI / lint (pull_request) Failing after 11s
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
CI / lint (pull_request) Failing after 11s
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:
@@ -290,14 +290,14 @@ int main(int argc, char* argv[]) {
|
||||
goto cleanup;
|
||||
}
|
||||
} else if (strcmp(argv[i], "--exclude-from") == 0 && i + 1 < argc) {
|
||||
if (read_patterns_from_file(argv[++i], &config->exclude_patterns,
|
||||
&config->exclude_count) != 0) {
|
||||
if (read_patterns_from_file(argv[++i], &config->exclude_patterns, &config->exclude_count) !=
|
||||
0) {
|
||||
exit_code = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
} else if (strcmp(argv[i], "--include-from") == 0 && i + 1 < argc) {
|
||||
if (read_patterns_from_file(argv[++i], &config->include_patterns,
|
||||
&config->include_count) != 0) {
|
||||
if (read_patterns_from_file(argv[++i], &config->include_patterns, &config->include_count) !=
|
||||
0) {
|
||||
exit_code = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -365,8 +365,8 @@ static int scan_directory_multithreaded(void* pipeline_context) {
|
||||
DirectoryScanner* scanner = directory_scanner_create(
|
||||
context->config->send_directory, context->config->use_metadata, context->config->chunk_size,
|
||||
context->config->exclude_patterns, context->config->exclude_count,
|
||||
context->config->include_patterns, context->config->include_count, context->config->max_size,
|
||||
context->config->min_size, context->config->max_depth);
|
||||
context->config->include_patterns, context->config->include_count, context->config->max_size,
|
||||
context->config->min_size, context->config->max_depth);
|
||||
mtx_unlock(&context->mutex_scanner);
|
||||
|
||||
Chunk* current_chunk;
|
||||
@@ -491,7 +491,7 @@ int send_files(Config* config) {
|
||||
DirectoryScanner* scanner = directory_scanner_create(
|
||||
config->send_directory, config->use_metadata, config->chunk_size, config->exclude_patterns,
|
||||
config->exclude_count, config->include_patterns, config->include_count, config->max_size,
|
||||
config->min_size, config->max_depth);
|
||||
config->min_size, config->max_depth);
|
||||
ArrayList* all_files = array_list_create(NULL);
|
||||
ArrayList* manifest = config->use_delete ? array_list_create(free) : NULL;
|
||||
Chunk* current_chunk;
|
||||
@@ -564,7 +564,7 @@ int send_files(Config* config) {
|
||||
continue;
|
||||
}
|
||||
if (!file_send_single_calls(file, client->file_descriptor, config->use_metadata,
|
||||
compression_level, true)) {
|
||||
compression_level, true)) {
|
||||
log_message(LOG_LEVEL_ERROR, "Failed to send file");
|
||||
batch_ok = false;
|
||||
break;
|
||||
|
||||
@@ -37,8 +37,7 @@ DirectoryScanner* directory_scanner_create(char* root_directory, bool use_metada
|
||||
unsigned long long chunk_size, char** exclude_patterns,
|
||||
int exclude_count, char** include_patterns,
|
||||
int include_count, unsigned long long max_size,
|
||||
unsigned long long min_size,
|
||||
int max_depth) {
|
||||
unsigned long long min_size, int max_depth) {
|
||||
DirectoryScanner* scanner = malloc(sizeof(DirectoryScanner));
|
||||
if (scanner == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -26,8 +26,7 @@ DirectoryScanner* directory_scanner_create(char* root_directory, bool use_metada
|
||||
unsigned long long chunk_size, char** exclude_patterns,
|
||||
int exclude_count, char** include_patterns,
|
||||
int include_count, unsigned long long max_size,
|
||||
unsigned long long min_size,
|
||||
int max_depth);
|
||||
unsigned long long min_size, int max_depth);
|
||||
Chunk* directory_scanner_next(DirectoryScanner* scanner);
|
||||
void directory_scanner_destroy(DirectoryScanner* scanner);
|
||||
|
||||
|
||||
+1
-2
@@ -22,8 +22,7 @@ int receive_files(Config* config, int fd) {
|
||||
return -1;
|
||||
|
||||
while (status == STATUS_NEXT || status == STATUS_CHUNK || status == STATUS_CHECK ||
|
||||
status == STATUS_KEEPALIVE || status == STATUS_ABORT ||
|
||||
status == STATUS_CHECK_BATCH) {
|
||||
status == STATUS_KEEPALIVE || status == STATUS_ABORT || status == STATUS_CHECK_BATCH) {
|
||||
if (status == STATUS_KEEPALIVE) {
|
||||
send_status(fd, STATUS_KEEPALIVE);
|
||||
goto next;
|
||||
|
||||
@@ -106,8 +106,7 @@ int receive_thread(void* pipeline_context) {
|
||||
if (!receive_status(file_descriptor, &status))
|
||||
return thrd_error;
|
||||
while (status == STATUS_NEXT || status == STATUS_CHUNK || status == STATUS_CHECK ||
|
||||
status == STATUS_KEEPALIVE || status == STATUS_ABORT ||
|
||||
status == STATUS_CHECK_BATCH) {
|
||||
status == STATUS_KEEPALIVE || status == STATUS_ABORT || status == STATUS_CHECK_BATCH) {
|
||||
if (status == STATUS_KEEPALIVE) {
|
||||
send_status(file_descriptor, STATUS_KEEPALIVE);
|
||||
goto next;
|
||||
|
||||
Reference in New Issue
Block a user