fix: make file_send_single_calls metadata conditional, add missing stdbool.h
This commit is contained in:
+3
-2
@@ -123,9 +123,10 @@ FileMetadata *file_receive_metadata(int file_descriptor) {
|
||||
return m;
|
||||
}
|
||||
|
||||
void file_send_single_calls(File *file, int file_descriptor) {
|
||||
void file_send_single_calls(File *file, int file_descriptor, bool use_metadata) {
|
||||
send_str(file_descriptor, file->path);
|
||||
metadata_send(file_descriptor, file->metadata);
|
||||
if (use_metadata)
|
||||
metadata_send(file_descriptor, file->metadata);
|
||||
printf("Sending File: %ld", file->data->size);
|
||||
send_data(file_descriptor, file->data->data, file->data->size);
|
||||
}
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
#define FILE_H
|
||||
|
||||
#include "data.h"
|
||||
#include <stdbool.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
typedef struct {
|
||||
@@ -22,7 +23,7 @@ File *file_create(const char *path);
|
||||
void file_destroy(void *item);
|
||||
void file_load_data(File *file);
|
||||
void file_print(void *item);
|
||||
void file_send_single_calls(File *file, int file_descriptor);
|
||||
void file_send_single_calls(File *file, int file_descriptor, bool use_metadata);
|
||||
void file_send_sendfile(File *file, int file_descriptor);
|
||||
size_t file_content_to_buffer(File *file);
|
||||
FileMetadata *file_metadata_create(struct stat *stats);
|
||||
|
||||
Reference in New Issue
Block a user