In make_file(), only compute the checksum when we're the sender.
authorWayne Davison <wayned@samba.org>
Thu, 10 Nov 2005 06:01:55 +0000 (06:01 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 10 Nov 2005 06:01:55 +0000 (06:01 +0000)
This stops computing useless checksums during the delete scan
when --checksum (-c) was specified.

flist.c

diff --git a/flist.c b/flist.c
index 3e7481f..a24c117 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -820,7 +820,7 @@ struct file_struct *make_file(char *fname, struct file_list *flist,
                                return NULL;
        }
 
-skip_filters:
+    skip_filters:
 
        if (verbose > 2) {
                rprintf(FINFO, "[%s] make_file(%s,*,%d)\n",
@@ -848,7 +848,8 @@ skip_filters:
        linkname_len = 0;
 #endif
 
-       sum_len = always_checksum && S_ISREG(st.st_mode) ? MD4_SUM_LENGTH : 0;
+       sum_len = always_checksum && am_sender && S_ISREG(st.st_mode)
+               ? MD4_SUM_LENGTH : 0;
 
        alloc_len = file_struct_len + dirname_len + basename_len
            + linkname_len + sum_len;