Files
FastSync/src/shared/config.h
T
TapTap ca29109664 perf: downsized test data, increased SSH socket buffer, and made chunk size configurable
- Reduced test data from 50MB to 25MB (test.py)
- Increased SSH socketpair buffer to 1MB via setsockopt (transport_ssh.c)
- Made chunk size configurable: new Config field, --chunk-size CLI flag,
  sent over wire, and used in scanner instead of DESIRED_CHUNK_SIZE
- Fixed DESIRED_CHUNK_SIZE macro parentheses (chunk.h)
2026-07-16 12:20:02 +02:00

42 lines
1.1 KiB
C

#ifndef CONFIG_H
#define CONFIG_H
#include <stdbool.h>
typedef enum {
TRANSPORT_TCP,
TRANSPORT_SSH
} TransportType;
typedef struct Config {
char *version;
char *send_directory;
char *receive_root_directory;
bool save_to_disk;
bool use_multithreading;
bool use_chunk_serialization;
bool use_compression;
bool use_sendfile;
bool use_metadata;
int compression_level;
unsigned long long chunk_size;
TransportType transport;
char *ssh_destination;
} Config;
#define DEFAULT_CHUNK_SIZE (10 * 1024 * 1024)
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, bool use_sendfile,
unsigned long long chunk_size);
void config_delete(Config *config);
void config_send(int file_descriptor, Config *config);
Config *config_receive(int file_descriptor);
bool is_remote_dest(const char *s);
void config_parse_ssh_dest(Config *config);
#endif