b2d3ce5884
- New STATUS_CHECK protocol status (value 6) - Client sends path + size + mtime; server replies OK (skip) or NEXT (send) - config.h/c: use_incremental field sent/received over wire - file.c/h: file_send_single_calls_no_path helper for incremental path - client_cli.c: --incremental flag - client_send.c: per-file check before send in both single and chunk paths - server.c: STATUS_CHECK handling in receive_files() - multiprocessing.c: STATUS_CHECK handling in receive_thread() - test.py: incremental sync test case
25 lines
820 B
C
25 lines
820 B
C
#ifndef PROTOCOL_H
|
|
#define PROTOCOL_H
|
|
|
|
#include "data.h"
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
|
|
typedef int Status;
|
|
enum NET_STATUS { STATUS_OK, STATUS_ERROR, STATUS_FINISHED, STATUS_NEXT, STATUS_CHUNK, STATUS_MANIFEST, STATUS_CHECK };
|
|
|
|
void io_set_fds(int read_fd, int write_fd);
|
|
bool send_n_data(int file_descriptor, void *data, size_t data_size);
|
|
bool receive_n_data(int file_descriptor, void *data, size_t data_size);
|
|
|
|
bool send_str(int file_descriptor, char *data);
|
|
char *receive_str(int file_descriptor);
|
|
bool send_data(int file_descriptor, Data *data);
|
|
Data *receive_data(int file_descriptor);
|
|
bool send_int(int file_descriptor, int data);
|
|
bool receive_int(int file_descriptor, int *data);
|
|
bool send_status(int file_descriptor, Status status);
|
|
bool receive_status(int file_descriptor, Status *status);
|
|
|
|
#endif
|