mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-21 21:34:17 -04:00
A slight compensation I had just added for total bytes read when using -v
was incorrect. It's hard to tell how many bytes are actually read because transferring the value changes it and depending on its value it may transfer 4 or 12 bytes so instead change the sender side to not include the length of the counters it sends at all (it had been including one but three are sent).
This commit is contained in:
1 parent
e19452a96c
commit
23c5aef18e
1 file changed
+9
-8
@@ -42,8 +42,12 @@ static void report(int f)
|
||||
|
||||
if (am_server) {
|
||||
if (verbose && am_sender) {
|
||||
int64 w;
|
||||
/* store total_written in a temporary
|
||||
because write_longint changes it */
|
||||
w = stats.total_written;
|
||||
write_longint(f,stats.total_read);
|
||||
write_longint(f,stats.total_written);
|
||||
write_longint(f,w);
|
||||
write_longint(f,stats.total_size);
|
||||
}
|
||||
return;
|
||||
@@ -57,15 +61,12 @@ static void report(int f)
|
||||
is identical but the bytes read and written are slightly
|
||||
different. It's done this way to avoid modifying the
|
||||
protocol to support --stats without -v. */
|
||||
int64 r;
|
||||
stats.total_written = read_longint(f);
|
||||
stats.total_read = read_longint(f);
|
||||
/* store total_read in a temporary, read_longint changes it */
|
||||
r = read_longint(f);
|
||||
stats.total_size = read_longint(f);
|
||||
|
||||
/* when the total_read was set above just now it would not
|
||||
have included the last two longints, but the last
|
||||
read_longint would have compensated for one of them.
|
||||
Compensate for the other one too by adding 8. */
|
||||
stats.total_read += sizeof(int64);
|
||||
stats.total_read = r;
|
||||
}
|
||||
|
||||
if (do_stats) {
|
||||
|
||||
Reference in new issue
Block a user