diff options
author | Wayne Davison <wayned@samba.org> | 2015-09-07 09:46:31 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2015-09-07 10:07:17 -0700 |
commit | cce44865c1ac64a434390b96489252ed576ef951 (patch) | |
tree | 123a5cfe272ff5b3ca18ac8e72063ce6d56901d6 | |
parent | 1983198097f57cb9c2eb44ae51cbf8c2cabccbe4 (diff) | |
download | rsync-cce44865c1ac64a434390b96489252ed576ef951.tar.gz |
Fixed logging of %b & %c when using --log-file.
The %b and %c escapes were outputting cumulative values when logged via
--log-file only (the bug didn't affect daemon transfer logging or the
output of the client's --out-format info). Also unified the %b & %c
switch case to make it easier to maintain. Fixes bug 11496.
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | log.c | 13 | ||||
-rw-r--r-- | receiver.c | 3 | ||||
-rw-r--r-- | sender.c | 3 |
4 files changed, 7 insertions, 16 deletions
@@ -21,6 +21,8 @@ Changes since 3.1.1: - Don't create an empty backup dir for a transferred file that doesn't exist yet. - Allow more than 32 group IDs per user in the daemon's gid=LIST config. + - Fix the logging of %b & %c via --log-file (daemon logging was already + correct, as was --out-format='%b/%c'). ENHANCEMENTS: @@ -28,6 +30,8 @@ Changes since 3.1.1: - Use usleep() for our msleep() function if it is available. - Added a few extra long-option names to rrsync script, which will make BackupPC happier. + - Made configure choose to use linux xattrs on netbsd (rather than not + supporting xattrs). - Misc. manpage tweaks. DEVELOPER RELATED: @@ -656,21 +656,10 @@ static void log_formatted(enum logcode code, const char *format, const char *op, n = auth_user; break; case 'b': - if (!(iflags & ITEM_TRANSFER)) - b = 0; - else if (am_sender) - b = total_data_written - initial_data_written; - else - b = total_data_read - initial_data_read; - strlcat(fmt, "s", sizeof fmt); - snprintf(buf2, sizeof buf2, fmt, - do_big_num(b, humanize, NULL)); - n = buf2; - break; case 'c': if (!(iflags & ITEM_TRANSFER)) b = 0; - else if (!am_sender) + else if ((!!am_sender) ^ (*p == 'c')) b = total_data_written - initial_data_written; else b = total_data_read - initial_data_read; @@ -672,8 +672,7 @@ int recv_files(int f_in, int f_out, char *local_name) } } - if (!log_before_transfer) - remember_initial_stats(); + remember_initial_stats(); if (!do_xfers) { /* log the transfer */ log_item(FCLIENT, file, iflags, NULL); @@ -320,8 +320,7 @@ void send_files(int f_in, int f_out) stats.xferred_files++; stats.total_transferred_size += F_LENGTH(file); - if (!log_before_transfer) - remember_initial_stats(); + remember_initial_stats(); if (!do_xfers) { /* log the transfer */ log_item(FCLIENT, file, iflags, NULL); |