quality: refactors (#321-#326) + fake-super directories (#319) #329

Merged
TapTap merged 14 commits from quality/refactor into dev 2026-09-24 03:17:42 +02:00
Owner

Quality cycle — closes #319, #321, #322, #323, #324, #325, #326

Behavior-preserving refactors plus the --fake-super-for-directories feature. No wire change (PROTOCOL_VERSION stays 2.30.0).

  • #319 --fake-super now records/restores a directory's stat via user.rsync.%stat (permission bits on disk, never real-chown), rsync-interoperable.
  • #321 receive_delta_file decomposed into a dispatcher + receive_delta_data_branch/receive_next_branch with a NULL-guarded fail: label (282 → 43 lines).
  • #322 shared scanner_build_file_entry() for the sequential and parallel scanners; scan_root_entry split per node kind with a single goto done.
  • #323 one client_connect_and_bind_session() + client_prepare_files_from() replacing three copy-pasted session-setup blocks and the duplicated files-from preamble.
  • #324 server.c main() (265 → 27 lines) decomposed into configure/hash-credentials/stdio/daemon entrypoints.
  • #325 delete_walk_fd split into child-walk/pass helpers; delete_missing_args_budgeted_observed split into delete_one_missing_arg/delete_nonempty_missing_dir.
  • #326 named IDENTITY_MAX_NAME_LEN, SCANNER_RESULT_QUEUE_CAP, SERVER_DEFAULT_MAX_CONNECTIONS.

Review follow-ups (fixed before merge)

Two reviews found: a critical parallel-scanner error-propagation bug (scan_root_add_non_dir did not mark the scan failed on real builder failures, silently dropping an entry and reporting success), a link_target leak on pruned root symlinks, a removed delta basis guard, and a pre-existing meta leak in --append resume on error paths. All fixed.

Verification

Strict -Werror, clang-format 18, cppcheck clean; unit 45/45 (ASan with leak detection, UBSan, valgrind); integration 945 passed; differential parity 84 passed.

## Quality cycle — closes #319, #321, #322, #323, #324, #325, #326 Behavior-preserving refactors plus the `--fake-super`-for-directories feature. No wire change (`PROTOCOL_VERSION` stays 2.30.0). - **#319** `--fake-super` now records/restores a directory's stat via `user.rsync.%stat` (permission bits on disk, never real-chown), rsync-interoperable. - **#321** `receive_delta_file` decomposed into a dispatcher + `receive_delta_data_branch`/`receive_next_branch` with a NULL-guarded `fail:` label (282 → 43 lines). - **#322** shared `scanner_build_file_entry()` for the sequential and parallel scanners; `scan_root_entry` split per node kind with a single `goto done`. - **#323** one `client_connect_and_bind_session()` + `client_prepare_files_from()` replacing three copy-pasted session-setup blocks and the duplicated files-from preamble. - **#324** `server.c` `main()` (265 → 27 lines) decomposed into configure/hash-credentials/stdio/daemon entrypoints. - **#325** `delete_walk_fd` split into child-walk/pass helpers; `delete_missing_args_budgeted_observed` split into `delete_one_missing_arg`/`delete_nonempty_missing_dir`. - **#326** named `IDENTITY_MAX_NAME_LEN`, `SCANNER_RESULT_QUEUE_CAP`, `SERVER_DEFAULT_MAX_CONNECTIONS`. ### Review follow-ups (fixed before merge) Two reviews found: a critical parallel-scanner error-propagation bug (`scan_root_add_non_dir` did not mark the scan failed on real builder failures, silently dropping an entry and reporting success), a `link_target` leak on pruned root symlinks, a removed delta basis guard, and a pre-existing `meta` leak in `--append` resume on error paths. All fixed. ### Verification Strict `-Werror`, clang-format 18, cppcheck clean; unit 45/45 (ASan with leak detection, UBSan, valgrind); integration **945 passed**; differential parity **84 passed**.
TapTap added 14 commits 2026-09-24 03:12:30 +02:00
fix: scan-root error propagation, link_target leak, delta guard, meta leak (review)
CI / lint (pull_request) Successful in 1m51s
CI / parity-full (pull_request) Skipped
CI / sanitizers (address) (pull_request) Skipped
CI / sanitizers (undefined) (pull_request) Skipped
CI / fuzz-build (pull_request) Skipped
CI / coverage (pull_request) Skipped
CI / valgrind (pull_request) Skipped
CI / parity-fast (pull_request) Successful in 19s
CI / build-and-test (pull_request) Successful in 54s
13627e82fc
TapTap merged commit b7e95b8d96 into dev 2026-09-24 03:17:42 +02:00
TapTap deleted branch quality/refactor 2026-09-24 03:17: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#329