Phase 1+2: bug fixes and dead code cleanup

Phase 1 — Bugs:
- receive_data: fix unsigned long long vs size_t mismatch
- chunk_deserialize: add NULL check in multiprocessing.c and server.c
- file_content_to_buffer: add missing fclose on error path
- send_files_multithreaded: propagate sender thread result
- server: add SIGPIPE handler
- to_disk: check fwrite return value
- scanner: use S_ISDIR instead of !S_ISREG
- scanner: free cur_path before early return

Phase 2 — Cleanup:
- Remove unused chunk_decompress function
- Remove unused array_list_clear function
- Remove unused num_connections config field
- Remove duplicate FILE_METADATA_WIRE_SIZE macro
- Update tests for removed APIs
This commit is contained in:
2026-07-16 12:08:09 +02:00
parent 81800fa661
commit 8f4ea62ae7
17 changed files with 43 additions and 69 deletions
+1 -2
View File
@@ -19,7 +19,6 @@ typedef struct Config {
bool use_sendfile;
bool use_metadata;
int compression_level;
int num_connections;
TransportType transport;
char *ssh_destination;
} Config;
@@ -28,7 +27,7 @@ Config *config_create(char *version, char *send_directory,
char *receive_directory, bool save_to_disk,
bool use_multithreading, bool use_chunk_serialization,
bool use_compression, bool use_metadata,
int compression_level, int num_connections, bool use_sendfile);
int compression_level, bool use_sendfile);
void config_delete(Config *config);
void config_send(int file_descriptor, Config *config);
Config *config_receive(int file_descriptor);