9 Commits

Author SHA1 Message Date
TapTap bd0c986a59 refactor: consolidate _no_path file send variants
Add bool send_path parameter to file_send_single_calls and
file_send_sendfile, remove the _no_path variants. Callers in
client_send.c pass true (send path) or false (skip path) based
on whether an incremental check already transmitted the path.
2026-07-18 17:06:14 +02:00
TapTap 2979f435d8 refactor: extract receive_chunk_data and receive_manifest shared helpers
- receive_chunk_data(fd, config) -> Chunk*: shared receive/decompress/deserialize
  (eliminates ~25 lines of duplication between server.c and multiprocessing.c)
- receive_manifest(fd, config, next_status): moved from server.c to file.c,
  fixes missing 'Deleting files not in manifest...' log in multiprocessing.c
- Removes redundant manual free loop in multiprocessing.c manifest handling
  (array_list_create(free) destructor already handles this)
- server.c and multiprocessing.c: remove local chunk/manifest helpers,
  remove compression.h include (no longer needed)
2026-07-18 17:00:11 +02:00
TapTap 38b59ad53c refactor: deduplicate server receive logic, extract shared helpers
- Extract file_save_to_disk() helper (replaces 4x duplicated disk-save boilerplate)
- Extract receive_incremental_check() shared helper (deduplicates STATUS_CHECK
  handling between server.c single-threaded and multiprocessing.c multi-threaded paths)
- Break receive_files() into receive_chunk() and receive_manifest() sub-handlers
- Add incremental sync test case to test.py
- Rebase onto main
2026-07-18 16:47:39 +02:00
TapTap 5cde1a832d fix: address review #69 - STATUS_ERROR sends, metadata_receive error handling, extract incremental_check helper 2026-07-18 16:38:33 +02:00
TapTap 9ca056c4cf Fix incremental-sync review: sendfile_no_path, reject -s+incremental, no data mutation, auto -M, STATUS_ERROR handling, PROTOCOL_VERSION bump 2026-07-18 16:38:33 +02:00
TapTap 109064441a Incremental sync: --incremental flag to skip unchanged files
- 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
2026-07-18 16:38:33 +02:00
TapTap ecd486a8d0 fix: bw_tokens initialized to io_bwlimit, overflow check for --bwlimit 2026-07-18 16:38:33 +02:00
TapTap 115e492a54 Fix bwlimit review: remove __thread (breaks -m), validate >0, handle nanosleep EINTR 2026-07-18 16:38:33 +02:00
TapTap 34510ac921 Bandwidth throttling: --bwlimit <KB/s> with token bucket
- protocol.h/c: io_set_bwlimit() + token bucket in send_n_data
  (64KB chunks, nanosleep-based deficit compensation)
- client_cli.c: --bwlimit <KB/s> flag
- test.py: bandwidth limit test case
2026-07-18 16:38:33 +02:00
4 changed files with 1 additions and 31 deletions
-23
View File
@@ -1,23 +0,0 @@
name: CI
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
container: gitea.tap-tap.win/taptap/fastsync-ci:v4
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: cmake -B build -S .
- name: Build
run: cmake --build build -j$(nproc)
- name: Unit Tests
run: ./build/tests
- name: Integration Tests
run: python3 test.py
+1 -1
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.22)
cmake_minimum_required(VERSION 4.1)
project(FastFileTransfer)
-6
View File
@@ -1,6 +0,0 @@
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc g++ make libc6-dev cmake libzstd-dev git ca-certificates curl && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
rm -rf /var/lib/apt/lists/*
-1
View File
@@ -8,7 +8,6 @@ pkgs.mkShell {
cmake
gnumake
pkg-config
docker
tea
];