Merge all 5 PRs: security, CLI features, protocol, performance, tests/docs
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:
2026-07-21 18:01:02 +02:00
parent 3b5d89fdb9
commit 415adf2077
9 changed files with 53 additions and 33 deletions
+4 -4
View File
@@ -305,7 +305,7 @@ static int scan_directory_multithreaded(void* pipeline_context) {
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, 4);
context->config->min_size, context->config->max_depth, 4);
Chunk* current_chunk;
while ((current_chunk = parallel_scanner_next(scanner)) != NULL) {
@@ -368,7 +368,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->min_size, config->max_depth);
Chunk* chunk;
int file_count = 0;
unsigned long long total_bytes = 0;
@@ -421,7 +421,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->min_size, config->max_depth);
Chunk* current_chunk;
unsigned long long total_bytes = 0;
time_t last_progress = 0;
@@ -510,7 +510,7 @@ int send_files_multithreaded(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->min_size, config->max_depth);
Chunk* chunk;
int file_count = 0;
unsigned long long total_bytes = 0;
+5 -2
View File
@@ -215,6 +215,7 @@ typedef struct {
int include_count;
unsigned long long max_size;
unsigned long long min_size;
int max_depth;
} ParallelWorkerArg;
static int parallel_worker_thread(void* arg) {
@@ -222,7 +223,7 @@ static int parallel_worker_thread(void* arg) {
for (int i = 0; i < wa->dir_count; i++) {
DirectoryScanner* ds = directory_scanner_create(
wa->dirs[i], wa->use_metadata, wa->chunk_size, wa->exclude_patterns, wa->exclude_count,
wa->include_patterns, wa->include_count, wa->max_size, wa->min_size);
wa->include_patterns, wa->include_count, wa->max_size, wa->min_size, wa->max_depth);
Chunk* chunk;
while ((chunk = directory_scanner_next(ds)) != NULL) {
queue_enqueue_multithreaded(wa->ps->result_queue, chunk, &wa->ps->result_mutex,
@@ -248,7 +249,8 @@ ParallelScanner* parallel_scanner_create(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,
unsigned long long min_size, int num_threads) {
unsigned long long min_size, int max_depth,
int num_threads) {
ParallelScanner* ps = calloc(1, sizeof(ParallelScanner));
if (!ps)
return NULL;
@@ -406,6 +408,7 @@ ParallelScanner* parallel_scanner_create(char* root_directory, bool use_metadata
wa->include_count = include_count;
wa->max_size = max_size;
wa->min_size = min_size;
wa->max_depth = max_depth;
start += count;
if (thrd_create(&ps->threads[t], parallel_worker_thread, wa) != thrd_success) {
for (int j = 0; j < count; j++)
+6 -3
View File
@@ -19,6 +19,8 @@ typedef struct {
int include_count;
unsigned long long max_size;
unsigned long long min_size;
int max_depth;
int current_depth;
} DirectoryScanner;
typedef struct {
@@ -33,11 +35,11 @@ typedef struct {
Chunk* initial_chunk;
} ParallelScanner;
DirectoryScanner* directory_scanner_create(char* root_directory, bool use_metadata,
DirectoryScanner* directory_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,
unsigned long long min_size);
unsigned long long min_size, int max_depth);
Chunk* directory_scanner_next(DirectoryScanner* scanner);
void directory_scanner_destroy(DirectoryScanner* scanner);
@@ -45,7 +47,8 @@ ParallelScanner* parallel_scanner_create(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,
unsigned long long min_size, int num_threads);
unsigned long long min_size, int max_depth,
int num_threads);
Chunk* parallel_scanner_next(ParallelScanner* scanner);
void parallel_scanner_destroy(ParallelScanner* scanner);