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:
@@ -49,16 +49,4 @@ void test_array_list() {
|
||||
list->item_destroyer = test_destroyer;
|
||||
array_list_delete(list);
|
||||
EXPECT_EQ_INT(destroyer_calls, 106);
|
||||
|
||||
// Test clear with NULL destroyer
|
||||
list = array_list_create(NULL);
|
||||
int a = 1, b = 2;
|
||||
array_list_add(list, &a);
|
||||
array_list_add(list, &b);
|
||||
EXPECT_EQ_INT(list->size, 2);
|
||||
array_list_clear(list);
|
||||
EXPECT_EQ_INT(list->size, 0);
|
||||
EXPECT_NULL(list->items[0]);
|
||||
EXPECT_NULL(list->items[1]);
|
||||
array_list_delete(list);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user