client: report rsync's 16-byte %c sum header for whole-file transfers
rsync's %c counts the block-checksum bytes received: even a whole-file transfer with no basis receives rsync's 16-byte sum header (append and inplace included), while a dry run receives nothing. FastSync's whole-file path has no equivalent header, so report 16 for parity when delta is inactive, keep 0 for dry runs, and keep the real received bytes when delta is active (FastSync's signature framing differs, so delta %c stays divergent). Add a strict %c/%l/%n differential against rsync and turn the %b check into a real rsync differential (semantics: both count wire bytes and exceed %l; the exact values are protocol-specific).
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
B=/workspace/build-ci
|
||||
D=/workspace/.probe
|
||||
rm -rf $D && mkdir -p $D/src $D/dst
|
||||
head -c 200000 /dev/urandom > $D/src/f.bin
|
||||
$B/server -p 45995 --allow-unauthenticated >$D/srv.log 2>&1 &
|
||||
SRV=$!; sleep 0.7
|
||||
for flags in "" "--incremental" "--incremental --delta"; do
|
||||
rm -rf $D/dst; mkdir -p $D/dst
|
||||
echo "=== fastsync flags='$flags' fresh: %b %c %l %n ==="
|
||||
$B/client --source-dir $D/src --dest-dir $D/dst --server-port 45995 --save-to-disk -a $flags --out-format="%b %c %l %n" 2>&1 | grep -v ERROR
|
||||
done
|
||||
echo "=== rsync whole-file: ==="
|
||||
rm -rf $D/rsrc $D/rdst; mkdir -p $D/rsrc $D/rdst; head -c 200000 /dev/urandom > $D/rsrc/f.bin
|
||||
rsync -a --out-format="%b %c %l %n" $D/rsrc/ $D/rdst/
|
||||
kill $SRV 2>/dev/null || true
|
||||
Reference in New Issue
Block a user