./configure (optional if already run)
make
+based-on: 181c9faf928faad08ef095f4667afe460ec3bef6
diff --git a/checksum.c b/checksum.c
-index 811b5b6..f418dc2 100644
--- a/checksum.c
+++ b/checksum.c
@@ -98,7 +98,7 @@ void get_checksum2(char *buf, int32 len, char *sum)
struct map_struct *buf;
OFF_T i, len = size;
diff --git a/clientserver.c b/clientserver.c
-index b6afe00..2681f33 100644
--- a/clientserver.c
+++ b/clientserver.c
@@ -42,6 +42,8 @@ extern int numeric_ids;
extern int io_timeout;
extern int no_detach;
extern int write_batch;
-@@ -868,6 +870,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -862,6 +864,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
} else if (am_root < 0) /* Treat --fake-super from client as --super. */
am_root = 2;
filesfrom_fd = f_in;
diff --git a/flist.c b/flist.c
-index 09b4fc5..8a42d80 100644
--- a/flist.c
+++ b/flist.c
@@ -22,6 +22,7 @@
/* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
* F_PATHNAME(), or (2) "NULL, dir, dirlen" to chdir() to the supplied dir,
* with dir == NULL taken to be the starting directory, and dirlen < 0
-@@ -1105,7 +1351,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1114,7 +1360,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
STRUCT_STAT *stp, int flags, int filter_level)
{
static char *lastdir;
struct file_struct *file;
char thisname[MAXPATHLEN];
char linkname[MAXPATHLEN];
-@@ -1251,9 +1497,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1260,9 +1506,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(lastdir, thisname, len);
lastdir[len] = '\0';
lastdir_len = len;
basename_len = strlen(basename) + 1; /* count the '\0' */
#ifdef SUPPORT_LINKS
-@@ -1267,11 +1520,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1276,11 +1529,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
extra_len += EXTRA_LEN;
#endif
#if EXTRA_ROUNDING > 0
if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
-@@ -1347,8 +1597,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1357,8 +1607,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
if (unsort_ndx)
F_NDX(file) = stats.num_dirs;
-@@ -2462,7 +2718,7 @@ struct file_list *recv_file_list(int f)
+@@ -2472,7 +2728,7 @@ struct file_list *recv_file_list(int f)
flist_eof = 1;
}
if (protocol_version < 30) {
/* Recv the io_error flag */
-@@ -2683,7 +2939,7 @@ void flist_free(struct file_list *flist)
+@@ -2693,7 +2949,7 @@ void flist_free(struct file_list *flist)
/* This routine ensures we don't have any duplicate names in our file list.
* duplicate names can cause corruption because of the pipelining. */
{
char fbuf[MAXPATHLEN];
int i, prev_i;
-@@ -2734,7 +2990,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2744,7 +3000,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
/* If one is a dir and the other is not, we want to
* keep the dir because it might have contents in the
* list. Otherwise keep the first one. */
struct file_struct *fp = flist->sorted[j];
if (!S_ISDIR(fp->mode))
keep = i, drop = j;
-@@ -2750,8 +3006,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2760,8 +3016,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
} else
keep = j, drop = i;
rprintf(FINFO,
"removing duplicate name %s from file list (%d)\n",
f_name(file, fbuf), drop + flist->ndx_start);
-@@ -2773,7 +3029,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2783,7 +3039,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
}
flist->high = prev_i;
* paths, but this must be done _after_ the sorting phase. */
for (i = flist->low; i <= flist->high; i++) {
diff --git a/generator.c b/generator.c
-index 12007a1..48a5062 100644
--- a/generator.c
+++ b/generator.c
@@ -53,6 +53,7 @@ extern int delete_after;
}
statret = link_stat(fname, &sx.st, keep_dirlinks && is_dir);
-@@ -1612,7 +1621,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1616,7 +1625,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
;
else if (fnamecmp_type == FNAMECMP_FUZZY)
;
do_unlink(partialptr);
handle_partial_dir(partialptr, PDIR_DELETE);
diff --git a/hlink.c b/hlink.c
-index c9eb33a..6109266 100644
--- a/hlink.c
+++ b/hlink.c
@@ -413,7 +413,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname,
statret = 1;
if (unchanged_attrs(cmpbuf, file, &alt_sx))
diff --git a/itypes.h b/itypes.h
-index df34140..1bdf506 100644
--- a/itypes.h
+++ b/itypes.h
@@ -23,6 +23,12 @@ isDigit(const char *ptr)
{
return isprint(*(unsigned char *)ptr);
diff --git a/loadparm.c b/loadparm.c
-index 8e48e6d..899d2b5 100644
--- a/loadparm.c
+++ b/loadparm.c
@@ -132,6 +132,7 @@ typedef struct {
FN_LOCAL_INTEGER(lp_max_verbosity, max_verbosity)
FN_LOCAL_INTEGER(lp_syslog_facility, syslog_facility)
diff --git a/options.c b/options.c
-index e7c6c61..2e110f3 100644
--- a/options.c
+++ b/options.c
@@ -112,6 +112,7 @@ size_t bwlimit_writemax = 0;
{"block-size", 'B', POPT_ARG_LONG, &block_size, 0, 0, 0 },
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
-@@ -1630,6 +1633,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1631,6 +1634,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
break;
case OPT_INFO:
arg = poptGetOptArg(pc);
parse_output_words(info_words, info_levels, arg, USER_PRIORITY);
-@@ -1830,6 +1850,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1831,6 +1851,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
#endif
snprintf(err_buf, sizeof err_buf,
"--write-batch and --read-batch can not be used together\n");
diff --git a/rsync.h b/rsync.h
-index be7cf8a..ba8f3db 100644
--- a/rsync.h
+++ b/rsync.h
-@@ -712,6 +712,10 @@ extern int xattrs_ndx;
+@@ -716,6 +716,10 @@ extern int xattrs_ndx;
#define F_SUM(f) ((char*)OPT_EXTRA(f, LEN64_BUMP(f) + HLINK_BUMP(f) \
+ SUM_EXTRA_CNT - 1))
/* Some utility defines: */
#define F_IS_ACTIVE(f) (f)->basename[0]
#define F_IS_HLINKED(f) ((f)->flags & FLAG_HLINKED)
-@@ -902,6 +906,13 @@ typedef struct {
+@@ -903,6 +907,13 @@ typedef struct {
char fname[1]; /* has variable size */
} relnamecache;
#include "lib/mdigest.h"
#include "lib/wildmatch.h"
diff --git a/rsync.yo b/rsync.yo
-index 941f7a5..7aa62cf 100644
--- a/rsync.yo
+++ b/rsync.yo
@@ -323,6 +323,7 @@ to the detailed description below for a complete description. verb(
-r, --recursive recurse into directories
@@ -568,9 +569,9 @@ uses a "quick check" that (by default) checks if each file's size and time
of last modification match between the sender and receiver. This option
- changes this to compare a 128-bit MD4 checksum for each file that has a
+ changes this to compare a 128-bit checksum for each file that has a
matching size. Generating the checksums means that both sides will expend
-a lot of disk I/O reading all the data in the files in the transfer (and
-this is prior to any reading that will be done to transfer changed files),
The sending side generates its checksums while it is doing the file-system
scan that builds the list of the available files. The receiver generates
-@@ -578,12 +579,44 @@ its checksums when it is scanning for changed files, and will checksum any
+@@ -578,6 +579,8 @@ its checksums when it is scanning for changed files, and will checksum any
file that has the same size as the corresponding sender's file: files with
either a changed size or a changed checksum are selected for transfer.
Note that rsync always verifies that each em(transferred) file was
correctly reconstructed on the receiving side by checking a whole-file
checksum that is generated as the file is transferred, but that
- automatic after-the-transfer verification has nothing to do with this
- option's before-the-transfer "Does this file need to be updated?" check.
+@@ -587,6 +590,36 @@ option's before-the-transfer "Does this file need to be updated?" check.
+ For protocol 30 and beyond (first supported in 3.0.0), the checksum used is
+ MD5. For older protocols, the checksum used is MD4.
+dit(bf(--sumfiles=MODE)) This option tells rsync to make use of any cached
+checksum information it finds in per-directory .rsyncsums files when the
way of saying you want recursion and want to preserve almost
everything (with -H being a notable omission).
diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
-index d4978cd..0fc98fd 100644
--- a/rsyncd.conf.yo
+++ b/rsyncd.conf.yo
@@ -292,6 +292,17 @@ locking on this file to ensure that the max connections limit is not
attempted uploads will fail. If "read only" is false then uploads will
diff --git a/support/rsyncsums b/support/rsyncsums
new file mode 100755
-index 0000000..ce03c80
--- /dev/null
+++ b/support/rsyncsums
@@ -0,0 +1,201 @@