Fix exit() in library code, add --include/--max-size/--min-size #12

Merged
TapTap merged 1 commits from exit-and-select into main 2026-07-16 15:03:38 +02:00
Owner

Task 4: Fix exit() in library code — 13 shared library files changed to return error indicators instead of calling exit():

File Change
protocol.c send_n_data/receive_n_data return bool; all protocol functions propagate errors
data.c data_create_empty/reserve/create return NULL on alloc failure
compression.c data_compress/decompress return NULL on failure
metadata.c metadata_send returns bool; metadata_receive returns NULL on error
file.c file_create returns NULL; file_load_data/file_send_single_calls/file_send_sendfile return bool; to_disk returns bool
array_list.c array_list_create returns NULL; array_list_extend/add return bool
queue.c queue_create returns NULL; queue_enqueue/double_capacity return bool
utils.c mkdir_r returns bool; path_cat returns NULL on alloc failure
transport_tcp.c server_create/client_create return NULL; server_listen/client_connect return bool
transport_ssh.c client_connect_ssh returns NULL on any failure
config.c config_send returns bool; config_receive returns NULL on error
chunk.c chunk_create/serialize/compress return NULL on failure
multiprocessing.c context create functions return NULL; receive paths handle protocol errors

Callers updated: server.c (graceful error recovery), client_send.c (exit at app level), multiprocessing.c (error propagation).

Task 5: Selective file sync

  • --include : whitelist filter (only include matching files, OR logic)
  • --max-size : skip files larger than n bytes
  • --min-size : skip files smaller than n bytes
  • All filters integrated into DirectoryScanner
  • Fields in Config (local-only, not sent over wire)
**Task 4: Fix exit() in library code** — 13 shared library files changed to return error indicators instead of calling exit(): | File | Change | |---|---| | protocol.c | send_n_data/receive_n_data return bool; all protocol functions propagate errors | | data.c | data_create_empty/reserve/create return NULL on alloc failure | | compression.c | data_compress/decompress return NULL on failure | | metadata.c | metadata_send returns bool; metadata_receive returns NULL on error | | file.c | file_create returns NULL; file_load_data/file_send_single_calls/file_send_sendfile return bool; to_disk returns bool | | array_list.c | array_list_create returns NULL; array_list_extend/add return bool | | queue.c | queue_create returns NULL; queue_enqueue/double_capacity return bool | | utils.c | mkdir_r returns bool; path_cat returns NULL on alloc failure | | transport_tcp.c | server_create/client_create return NULL; server_listen/client_connect return bool | | transport_ssh.c | client_connect_ssh returns NULL on any failure | | config.c | config_send returns bool; config_receive returns NULL on error | | chunk.c | chunk_create/serialize/compress return NULL on failure | | multiprocessing.c | context create functions return NULL; receive paths handle protocol errors | Callers updated: server.c (graceful error recovery), client_send.c (exit at app level), multiprocessing.c (error propagation). **Task 5: Selective file sync** - --include <pattern>: whitelist filter (only include matching files, OR logic) - --max-size <n>: skip files larger than n bytes - --min-size <n>: skip files smaller than n bytes - All filters integrated into DirectoryScanner - Fields in Config (local-only, not sent over wire)
TapTap added 1 commit 2026-07-16 14:15:46 +02:00
TapTap merged commit 93a5768bf0 into main 2026-07-16 15:03:38 +02:00
TapTap deleted branch exit-and-select 2026-07-16 15:03:42 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#12