Some merge fixes.
authorWayne Davison <wayne@opencoder.net>
Tue, 21 Jul 2020 17:44:40 +0000 (10:44 -0700)
committerWayne Davison <wayne@opencoder.net>
Tue, 21 Jul 2020 17:45:49 +0000 (10:45 -0700)
checksum-updating.diff
db.diff
xxh3.diff

index cf3b7984b0612cf3ed807b80f328d8341bc1dc56..8bd28aba30fca6bb8ead279de388b9a97f01e5bc 100644 (file)
@@ -52,8 +52,8 @@ diff --git a/flist.c b/flist.c
 +      int checksum_updates;
  } *csum_cache = NULL;
  
- static void flist_sort_and_clean(struct file_list *flist, int flags);
-@@ -344,7 +353,79 @@ static void flist_done_allocating(struct file_list *flist)
+ static struct file_list *flist_new(int flags, const char *msg);
+@@ -345,7 +354,79 @@ static void flist_done_allocating(struct file_list *flist)
                flist->pool_boundary = ptr;
  }
  
@@ -134,7 +134,7 @@ diff --git a/flist.c b/flist.c
  {
        int slot, slots = am_sender ? 1 : basis_dir_cnt + 1;
  
-@@ -355,6 +436,9 @@ void reset_checksum_cache()
+@@ -356,6 +437,9 @@ void reset_checksum_cache()
                struct file_list *flist = csum_cache[slot].flist;
  
                if (flist) {
@@ -144,7 +144,7 @@ diff --git a/flist.c b/flist.c
                        /* Reset the pool memory and empty the file-list array. */
                        pool_free_old(flist->file_pool,
                                      pool_boundary(flist->file_pool, 0));
-@@ -365,6 +449,10 @@ void reset_checksum_cache()
+@@ -366,6 +450,10 @@ void reset_checksum_cache()
                flist->low = 0;
                flist->high = -1;
                flist->next = NULL;
@@ -155,7 +155,7 @@ diff --git a/flist.c b/flist.c
        }
  }
  
-@@ -372,7 +460,7 @@ void reset_checksum_cache()
+@@ -373,7 +461,7 @@ void reset_checksum_cache()
  static int add_checksum(struct file_list *flist, const char *dirname,
                        const char *basename, int basename_len, OFF_T file_length,
                        time_t mtime, uint32 ctime, uint32 inode,
@@ -164,7 +164,7 @@ diff --git a/flist.c b/flist.c
  {
        struct file_struct *file;
        int alloc_len, extra_len;
-@@ -389,7 +477,7 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -390,7 +478,7 @@ static int add_checksum(struct file_list *flist, const char *dirname,
        if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
                extra_len = (extra_len | (EXTRA_ROUNDING * EXTRA_LEN)) + EXTRA_LEN;
  #endif
@@ -173,7 +173,7 @@ diff --git a/flist.c b/flist.c
        bp = pool_alloc(flist->file_pool, alloc_len, "add_checksum");
  
        memset(bp, 0, extra_len + FILE_STRUCT_LEN);
-@@ -398,7 +486,14 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -399,7 +487,14 @@ static int add_checksum(struct file_list *flist, const char *dirname,
        bp += FILE_STRUCT_LEN;
  
        memcpy(bp, basename, basename_len);
@@ -188,7 +188,7 @@ diff --git a/flist.c b/flist.c
        file->mode = S_IFREG;
        file->modtime = mtime;
        file->len32 = (uint32)file_length;
-@@ -427,10 +522,11 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -428,10 +523,11 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
        char line[MAXPATHLEN+1024], fbuf[MAXPATHLEN], sum[MAX_DIGEST_LEN];
        FILE *fp;
        char *cp;
@@ -201,7 +201,7 @@ diff --git a/flist.c b/flist.c
        int dlen = dirname ? strlcpy(fbuf, dirname, sizeof fbuf) : 0;
  
        if (dlen >= (int)(sizeof fbuf - 1 - RSYNCSUMS_LEN))
-@@ -451,7 +547,7 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -452,7 +548,7 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
        while (fgets(line, sizeof line, fp)) {
                cp = line;
                if (checksum_type == 5) {
@@ -210,7 +210,7 @@ diff --git a/flist.c b/flist.c
                        if (*cp == '=')
                                while (*++cp == '=') {}
                        else
-@@ -462,7 +558,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -463,7 +559,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
                }
  
                if (*cp == '=') {
@@ -226,7 +226,7 @@ diff --git a/flist.c b/flist.c
                } else {
                        for (i = 0; i < flist_csum_len*2; i++, cp++) {
                                int x;
-@@ -480,13 +583,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -481,13 +584,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
                                else
                                        sum[i/2] = x << 4;
                        }
@@ -242,7 +242,7 @@ diff --git a/flist.c b/flist.c
                        if (*cp == '=')
                                while (*++cp == '=') {}
                        else
-@@ -536,24 +640,112 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -537,24 +641,112 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
                        continue;
  
                strlcpy(fbuf+dlen, cp, sizeof fbuf - dlen);
@@ -357,7 +357,7 @@ diff --git a/flist.c b/flist.c
                read_checksums(slot, flist, file->dirname);
        }
  
-@@ -565,12 +757,31 @@ void get_cached_checksum(int slot, const char *fname, struct file_struct *file,
+@@ -566,12 +758,31 @@ void get_cached_checksum(int slot, const char *fname, struct file_struct *file,
                 && (checksum_files & CSF_LAX
                  || (F_CTIME(fp) == (uint32)stp->st_ctime
                   && F_INODE(fp) == (uint32)stp->st_ino))) {
@@ -390,7 +390,7 @@ diff --git a/flist.c b/flist.c
  }
  
  /* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
-@@ -1502,6 +1713,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1511,6 +1722,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
        if (is_excluded(thisname, S_ISDIR(st.st_mode) != 0, filter_level)) {
                if (ignore_perishable)
                        non_perishable_cnt++;
@@ -399,7 +399,7 @@ diff --git a/flist.c b/flist.c
                return NULL;
        }
  
-@@ -1548,13 +1761,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1557,13 +1770,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                        lastdir[len] = '\0';
                        lastdir_len = len;
                        if (checksum_files && am_sender && flist)
@@ -415,7 +415,7 @@ diff --git a/flist.c b/flist.c
                }
        }
        basename_len = strlen(basename) + 1; /* count the '\0' */
-@@ -1662,7 +1875,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1671,7 +1884,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
  
        if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
                if (flist && checksum_files)
@@ -424,7 +424,7 @@ diff --git a/flist.c b/flist.c
                else
                        file_checksum(thisname, &st, tmp_sum);
                if (sender_keeps_checksum)
-@@ -2054,6 +2267,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -2063,6 +2276,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
  
        closedir(d);
  
@@ -434,7 +434,7 @@ diff --git a/flist.c b/flist.c
        if (f >= 0 && recurse && !divert_dirs) {
                int i, end = flist->used - 1;
                /* send_if_directory() bumps flist->used, so use "end". */
-@@ -2719,6 +2935,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2726,6 +2942,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
                        rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i());
        }
  
@@ -520,7 +520,7 @@ diff --git a/io.c b/io.c
  extern int protocol_version;
  extern int remove_source_files;
  extern int preserve_hard_links;
-@@ -1056,6 +1057,9 @@ static void got_flist_entry_status(enum festatus status, int ndx)
+@@ -1061,6 +1062,9 @@ static void got_flist_entry_status(enum festatus status, int ndx)
                                if (inc_recurse)
                                        flist->in_progress++;
                        }
@@ -547,7 +547,7 @@ diff --git a/loadparm.c b/loadparm.c
 diff --git a/options.c b/options.c
 --- a/options.c
 +++ b/options.c
-@@ -1755,7 +1755,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1939,7 +1939,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
  
                case OPT_SUMFILES:
                        arg = poptGetOptArg(pc);
@@ -596,7 +596,7 @@ diff --git a/receiver.c b/receiver.c
 diff --git a/rsync.1.md b/rsync.1.md
 --- a/rsync.1.md
 +++ b/rsync.1.md
-@@ -705,9 +705,13 @@ your home directory (remove the '=' for that).
+@@ -707,9 +707,13 @@ your home directory (remove the '=' for that).
  
      The MODE value is either "lax", for relaxed checking (which compares size
      and mtime), "strict" (which also compares ctime and inode), or "none" to
@@ -616,7 +616,7 @@ diff --git a/rsync.1.md b/rsync.1.md
 diff --git a/rsync.h b/rsync.h
 --- a/rsync.h
 +++ b/rsync.h
-@@ -1044,6 +1044,8 @@ typedef struct {
+@@ -1088,6 +1088,8 @@ typedef struct {
  
  #define CSF_ENABLE (1<<1)
  #define CSF_LAX (1<<2)
@@ -628,11 +628,11 @@ diff --git a/rsync.h b/rsync.h
 diff --git a/rsyncd.conf.5.md b/rsyncd.conf.5.md
 --- a/rsyncd.conf.5.md
 +++ b/rsyncd.conf.5.md
-@@ -409,13 +409,15 @@ the values of parameters.  See the GLOBAL PARAMETERS section for more details.
+@@ -424,13 +424,15 @@ the values of parameters.  See the GLOBAL PARAMETERS section for more details.
      This parameter tells rsync to make use of any cached checksum information
      it finds in per-directory .rsyncsums files when the current transfer is
      using the `--checksum` option.  The value can be set to either "lax",
--    "strict", or "none" -- see the client's `--sumfiles` option for what these
+-    "strict", or "none".  See the client's `--sumfiles` option for what these
 -    choices do.
 +    "strict", "+lax", "+strict", "++lax", "++strict", or +"none".  See the
 +    client's `--sumfiles` option for what these choices do.
diff --git a/db.diff b/db.diff
index 56b846af3bc8c05e5a38c96ff0632aa93f7e766e..1670645bc1c9e5aeaa16ff6de500505de5fbec97 100644 (file)
--- a/db.diff
+++ b/db.diff
@@ -21,7 +21,7 @@ To use this patch, run these commands for a successful build:
     ./configure
     make
 
-based-on: af531cf787995f6a3bc381cd1da1988192e7ef59
+based-on: 5eda68f11bf6efe782cca60a2415191f4532c3b5
 diff --git a/.gitignore b/.gitignore
 --- a/.gitignore
 +++ b/.gitignore
@@ -65,16 +65,16 @@ diff --git a/Makefile.in b/Makefile.in
  DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
  popt_OBJS=popt/findme.o  popt/popt.o  popt/poptconfig.o \
 @@ -75,10 +77,12 @@ install: all
-       -${MKDIR_P} ${DESTDIR}${bindir}
-       ${INSTALLCMD} ${INSTALL_STRIP} -m 755 rsync$(EXEEXT) ${DESTDIR}${bindir}
-       ${INSTALLCMD} -m 755 $(srcdir)/rsync-ssl ${DESTDIR}${bindir}
-+      rsync -ilt rsyncdb$(EXEEXT) ${DESTDIR}${bindir}/
-       -${MKDIR_P} ${DESTDIR}${mandir}/man1
-       -${MKDIR_P} ${DESTDIR}${mandir}/man5
-       if test -f rsync.1; then ${INSTALLMAN} -m 644 rsync.1 ${DESTDIR}${mandir}/man1; fi
-       if test -f rsync-ssl.1; then ${INSTALLMAN} -m 644 rsync-ssl.1 ${DESTDIR}${mandir}/man1; fi
-+      if test -f rsyncdb.1; then ${INSTALLMAN} -m 644 rsyncdb.1 ${DESTDIR}${mandir}/man1; fi
-       if test -f rsyncd.conf.5; then ${INSTALLMAN} -m 644 rsyncd.conf.5 ${DESTDIR}${mandir}/man5; fi
+       -$(MKDIR_P) $(DESTDIR)$(bindir)
+       $(INSTALLCMD) $(INSTALL_STRIP) -m 755 rsync$(EXEEXT) $(DESTDIR)$(bindir)
+       $(INSTALLCMD) -m 755 $(srcdir)/rsync-ssl $(DESTDIR)$(bindir)
++      rsync -ilt rsyncdb$(EXEEXT) $(DESTDIR)$(bindir)/
+       -$(MKDIR_P) $(DESTDIR)$(mandir)/man1
+       -$(MKDIR_P) $(DESTDIR)$(mandir)/man5
+       if test -f rsync.1; then $(INSTALLMAN) -m 644 rsync.1 $(DESTDIR)$(mandir)/man1; fi
+       if test -f rsync-ssl.1; then $(INSTALLMAN) -m 644 rsync-ssl.1 $(DESTDIR)$(mandir)/man1; fi
++      if test -f rsyncdb.1; then $(INSTALLMAN) -m 644 rsyncdb.1 $(DESTDIR)$(mandir)/man1; fi
+       if test -f rsyncd.conf.5; then $(INSTALLMAN) -m 644 rsyncd.conf.5 $(DESTDIR)$(mandir)/man5; fi
  
  install-ssl-daemon: stunnel-rsyncd.conf
 @@ -96,10 +100,13 @@ install-strip:
@@ -181,7 +181,7 @@ diff --git a/cleanup.c b/cleanup.c
 diff --git a/clientserver.c b/clientserver.c
 --- a/clientserver.c
 +++ b/clientserver.c
-@@ -44,12 +44,15 @@ extern int numeric_ids;
+@@ -45,12 +45,15 @@ extern int numeric_ids;
  extern int filesfrom_fd;
  extern int remote_protocol;
  extern int protocol_version;
@@ -197,7 +197,7 @@ diff --git a/clientserver.c b/clientserver.c
  extern char *bind_address;
  extern char *config_file;
  extern char *logfile_format;
-@@ -810,6 +813,11 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -814,6 +817,11 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
  
        log_init(1);
  
@@ -207,9 +207,9 @@ diff --git a/clientserver.c b/clientserver.c
 +      }
 +
  #ifdef HAVE_PUTENV
-       if ((*lp_early_exec(module_id) || *lp_prexfer_exec(module_id) || *lp_postxfer_exec(module_id))
-        && !getenv("RSYNC_NO_XFER_EXEC")) {
-@@ -1009,6 +1017,8 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+       if ((*lp_early_exec(module_id) || *lp_prexfer_exec(module_id)
+         || *lp_postxfer_exec(module_id) || *lp_name_converter(module_id))
+@@ -1026,6 +1034,8 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
  
        am_server = 1; /* Don't let someone try to be tricky. */
        quiet = 0;
@@ -289,7 +289,7 @@ diff --git a/daemon-parm.txt b/daemon-parm.txt
  STRING        dont_compress           DEFAULT_DONT_COMPRESS
  STRING        early_exec              NULL
  STRING        exclude                 NULL
-@@ -50,6 +51,7 @@ INTEGER      timeout                 0
+@@ -51,6 +52,7 @@ INTEGER      timeout                 0
  
  ENUM  syslog_facility         LOG_DAEMON
  
@@ -2256,7 +2256,7 @@ diff --git a/flist.c b/flist.c
  extern int eol_nulls;
  extern int atimes_ndx;
  extern int relative_paths;
-@@ -1324,11 +1325,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1325,11 +1326,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                extra_len += EXTRA_LEN;
  #endif
  
@@ -2270,7 +2270,7 @@ diff --git a/flist.c b/flist.c
  
  #if EXTRA_ROUNDING > 0
        if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
-@@ -1413,8 +1411,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1414,8 +1412,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                return NULL;
        }
  
@@ -2285,7 +2285,7 @@ diff --git a/flist.c b/flist.c
  
        if (unsort_ndx)
                F_NDX(file) = stats.num_dirs;
-@@ -2098,6 +2100,9 @@ void send_extra_file_list(int f, int at_least)
+@@ -2099,6 +2101,9 @@ void send_extra_file_list(int f, int at_least)
    finish:
        if (io_error != save_io_error && protocol_version == 30 && !ignore_errors)
                send_msg_int(MSG_IO_ERROR, io_error);
@@ -2295,7 +2295,7 @@ diff --git a/flist.c b/flist.c
  }
  
  struct file_list *send_file_list(int f, int argc, char *argv[])
-@@ -2121,6 +2126,13 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2122,6 +2127,13 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
                     | (eol_nulls || reading_remotely ? RL_EOL_NULLS : 0);
        int implied_dot_dir = 0;
  
@@ -2309,7 +2309,7 @@ diff --git a/flist.c b/flist.c
        rprintf(FLOG, "building file list\n");
        if (show_filelist_progress)
                start_filelist_progress("building file list");
-@@ -2464,6 +2476,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2465,6 +2477,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
                        rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i());
        }
  
@@ -2887,7 +2887,7 @@ diff --git a/rsync.h b/rsync.h
  #define NDX_DONE -1
  #define NDX_FLIST_EOF -2
  #define NDX_DEL_STATS -3
-@@ -1399,7 +1403,8 @@ extern short info_levels[], debug_levels[];
+@@ -1406,7 +1410,8 @@ extern short info_levels[], debug_levels[];
  #define DEBUG_CHDIR (DEBUG_BIND+1)
  #define DEBUG_CONNECT (DEBUG_CHDIR+1)
  #define DEBUG_CMD (DEBUG_CONNECT+1)
index 49491e9dad5b5ed873714dd89ec185696ce5b4a3..5b0e5295ab892a5673b64f8e4714002d4061f8fe 100644 (file)
--- a/xxh3.diff
+++ b/xxh3.diff
@@ -7,7 +7,7 @@ To use this patch, run these commands for a successful build:
     ./configure                         (optional if already run)
     make
 
-based-on: 194cee671d5e178f20c4494f41911fa8db942935
+based-on: 5eda68f11bf6efe782cca60a2415191f4532c3b5
 diff --git a/checksum.c b/checksum.c
 --- a/checksum.c
 +++ b/checksum.c
@@ -20,7 +20,7 @@ diff --git a/checksum.c b/checksum.c
  #include "rsync.h"
  
  #ifdef SUPPORT_XXHASH
- #include "xxhash.h"
+ #include <xxhash.h>
 -# if XXH_VERSION_NUMBER >= 800
 +# if XXH_VERSION_NUMBER >= 800 || defined XXH_INLINE_ALL
  #  define SUPPORT_XXH3 1