refactor: split transfer and protocol responsibilities #212

Open
TapTap wants to merge 9 commits from refactor/codebase-structure into dev
4 changed files with 6 additions and 6 deletions
Showing only changes of commit 3b7f97853c - Show all commits
+1 -1
View File
@@ -124,7 +124,7 @@ static void pipeline_cancel(PipelineContextSender* context) {
}
/* Print dry-run manifest showing files that would be transferred. Returns 0 on success. */
static int send_dry_run_manifest(Config* config) {
static int send_dry_run_manifest(const Config* config) {
ScannerOptions options = scanner_options_from_config(config, 0);
DirectoryScanner* scanner =
directory_scanner_create_with_options(config->send_directory, &options);
+3 -3
View File
@@ -252,7 +252,7 @@ Chunk* directory_scanner_next(DirectoryScanner* scanner) {
break;
}
struct dirent* entry = readdir(scanner->current_dir);
const struct dirent* entry = readdir(scanner->current_dir);
if (entry == NULL) {
closedir(scanner->current_dir);
scanner->current_dir = NULL;
@@ -454,7 +454,7 @@ ParallelScanner* parallel_scanner_create_with_options(const char* root_directory
parallel_scanner_destroy(ps);
return NULL;
}
struct dirent* entry;
const struct dirent* entry;
while ((entry = readdir(dir)) != NULL) {
if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
continue;
@@ -637,7 +637,7 @@ ParallelScanner* parallel_scanner_create_with_options(const char* root_directory
return ps;
}
ParallelScanner* parallel_scanner_create(char* root_directory, bool use_metadata,
ParallelScanner* parallel_scanner_create(const char* root_directory, bool use_metadata,
unsigned long long chunk_size, char** exclude_patterns,
int exclude_count, char** include_patterns,
int include_count, unsigned long long max_size,
+1 -1
View File
@@ -77,7 +77,7 @@ Chunk* directory_scanner_next(DirectoryScanner* scanner);
bool directory_scanner_failed(const DirectoryScanner* scanner);
void directory_scanner_destroy(DirectoryScanner* scanner);
ParallelScanner* parallel_scanner_create(char* root_directory, bool use_metadata,
ParallelScanner* parallel_scanner_create(const char* root_directory, bool use_metadata,
unsigned long long chunk_size, char** exclude_patterns,
int exclude_count, char** include_patterns,
int include_count, unsigned long long max_size,
+1 -1
View File
@@ -238,7 +238,7 @@ static void test_config_receive_truncated() {
EXPECT_TRUE(send_int(p[1], 1));
shutdown(p[1], SHUT_WR);
Config* cfg = config_receive(p[0]);
const Config* cfg = config_receive(p[0]);
EXPECT_NULL(cfg);
close(p[0]);
close(p[1]);