Fixed length check when excluding XSTAT_ATTR.
[rsync/rsync-patches.git] / early-checksum.diff
index 152d08f..948b1ed 100644 (file)
@@ -8,6 +8,12 @@ to its checksum pass during its normal find-the-different-files pass.
 I have benchmarked this a little, and it appears to slow things down
 for a local copy, so the old algorithm is used for local copies.
 
+To use this patch, run these commands for a successful build:
+
+    patch -p1 <patches/early-checksum.diff
+    ./configure                                 (optional if already run)
+    make
+
 --- old/flist.c
 +++ new/flist.c
 @@ -31,6 +31,7 @@ extern int am_daemon;
@@ -18,7 +24,7 @@ for a local copy, so the old algorithm is used for local copies.
  extern int module_id;
  extern int ignore_errors;
  extern int numeric_ids;
-@@ -693,6 +694,16 @@ static struct file_struct *receive_file_
+@@ -697,6 +698,16 @@ static struct file_struct *receive_file_
                        sum = empty_sum;
                }
                read_buf(f, sum, checksum_len);
@@ -73,7 +79,7 @@ for a local copy, so the old algorithm is used for local copies.
                                continue;
                        best_match = j;
                        match_level = 2;
-@@ -1210,7 +1214,7 @@ static void recv_generator(char *fname, 
+@@ -1215,7 +1219,7 @@ static void recv_generator(char *fname, 
                ;
        else if (fnamecmp_type == FNAMECMP_FUZZY)
                ;
@@ -84,8 +90,8 @@ for a local copy, so the old algorithm is used for local copies.
                        handle_partial_dir(partialptr, PDIR_DELETE);
 --- old/hlink.c
 +++ new/hlink.c
-@@ -220,7 +220,7 @@ int hard_link_check(struct file_struct *
-                                                       itemizing = code = 0;
+@@ -224,7 +224,7 @@ int hard_link_check(struct file_struct *
+                                               }
                                                break;
                                        }
 -                                      if (!unchanged_file(cmpbuf, file, &st3))
@@ -127,7 +133,7 @@ for a local copy, so the old algorithm is used for local copies.
  
 +      strlcpy(olddir, curr_dir, sizeof olddir);
 +      if (always_checksum && !local_server && argc > 0)
-+              pre_checksum = push_dir(argv[0]);
++              pre_checksum = push_dir(argv[0], 0);
 +
        flist = recv_file_list(f_in);
        verbose = save_verbose;
@@ -156,7 +162,7 @@ for a local copy, so the old algorithm is used for local copies.
  
 +      strlcpy(olddir, curr_dir, sizeof olddir);
 +      if (always_checksum && !local_server)
-+              pre_checksum = push_dir(argv[0]);
++              pre_checksum = push_dir(argv[0], 0);
 +
        if (write_batch && !am_server)
                start_write_batch(f_in);