feat(stats): populate receiver wire counters on both receive paths
The single-threaded and -m receivers never populated ReceiverStats.matched_data or .deleted_files, so --stats always printed 0 for both even when rsync reported nonzero. Track the bytes reconstructed from the basis file while applying a delta, and tally the delete-commit counts (manifest and per-directory sessions) into the receiver stats. The -m pipeline now carries its own stats/would-delete fields and emits the STATUS_STATS frame before the terminal success, so --threads finally reports the counters and renders -n --delete lines. Also normalize the -n --delete would-delete enumeration's absolute basis prefixes exactly like the real commit path (fixing an over-report) and fix the basis_delete_relative off-by-one when the receive root is '/'. Unit tests cover the root mapping and the basis protection; integration tests cover matched/deleted stats for both receivers and the --threads dry-run delete lines.
This commit is contained in:
@@ -444,6 +444,10 @@ bool delete_plan_session_limit_reached(const DeletePlanSession* session) {
|
||||
return session && session->limit_hit;
|
||||
}
|
||||
|
||||
size_t delete_plan_session_deleted(const DeletePlanSession* session) {
|
||||
return session ? session->deleted : 0;
|
||||
}
|
||||
|
||||
/* True for a destination-relative path section entry (non-empty, relative,
|
||||
* traversal-free). */
|
||||
static bool valid_rel_path(const char* value) {
|
||||
|
||||
Reference in New Issue
Block a user