The branch, master has been updated
       via  cce4486 Fixed logging of %b & %c when using --log-file.
      from  1983198 Add support for netbsd in xattrs case. Closes 
bug-suggestion 11484.

https://git.samba.org/?p=rsync.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit cce44865c1ac64a434390b96489252ed576ef951
Author: Wayne Davison <way...@samba.org>
Date:   Mon Sep 7 09:46:31 2015 -0700

    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.

-----------------------------------------------------------------------

Summary of changes:
 NEWS       |  4 ++++
 log.c      | 13 +------------
 receiver.c |  3 +--
 sender.c   |  3 +--
 4 files changed, 7 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/NEWS b/NEWS
index 3fe3d3e..3ab8b2d 100644
--- a/NEWS
+++ b/NEWS
@@ -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:
diff --git a/log.c b/log.c
index ef2c6ee..24256de 100644
--- a/log.c
+++ b/log.c
@@ -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;
diff --git a/receiver.c b/receiver.c
index 63f1c12..4ea4c09 100644
--- a/receiver.c
+++ b/receiver.c
@@ -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);
diff --git a/sender.c b/sender.c
index b4a5dbf..907cf21 100644
--- a/sender.c
+++ b/sender.c
@@ -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);


-- 
The rsync repository.

_______________________________________________
rsync-cvs mailing list
rsync-cvs@lists.samba.org
https://lists.samba.org/mailman/listinfo/rsync-cvs

Reply via email to