fixup: address PR review comments

- Merge io.h/c back into protocol.h/c
- Change send_data to take Data* argument
- Remove redundant file_load_data from send_chunk
- Move compression into file_send_single_calls
- Move file_receive from multiprocessing.c to file.c
This commit is contained in:
2026-07-16 11:54:20 +02:00
parent 02619cca5c
commit d36768792a
11 changed files with 87 additions and 100 deletions
-17
View File
@@ -74,23 +74,6 @@ void pipeline_context_receiver_destroy(PipelineContextReceiver *context) {
free(context);
}
File *file_receive(Config *config, int file_descriptor) {
char *path = (char *)receive_str(file_descriptor);
File *file = file_create(path);
free(path);
if (config->use_metadata)
file->metadata = metadata_receive(file_descriptor);
Data *file_data = receive_data(file_descriptor);
if (config->use_compression) {
Data *file_data_uncompressed = data_decompress(file_data);
data_destroy(file_data);
file_data = file_data_uncompressed;
}
data_destroy(file->data);
file->data = file_data;
return file;
}
static void receive_chunk_enqueue(int file_descriptor,
PipelineContextReceiver *context) {
Data *chunk_data = receive_data(file_descriptor);