[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Mon May 25 20:05:41 UTC 2020


The branch, master has been updated
       via  abef92c0 Fix handling of a compressor that has no off_level.
       via  87019d77 Output the default checksum & compress lists in the --version output.
       via  fc265c5a A couple minor configure.ac tweaks.
      from  d999efe6 Make compression-level handling generic.

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


- Log -----------------------------------------------------------------
commit abef92c03767d0c5dc9070eba15805f0f7075e6c
Author: Wayne Davison <wayne at opencoder.net>
Date:   Mon May 25 13:02:56 2020 -0700

    Fix handling of a compressor that has no off_level.

commit 87019d772130e0534ba975fbd97764d1e6af3c92
Author: Wayne Davison <wayne at opencoder.net>
Date:   Mon May 25 12:45:28 2020 -0700

    Output the default checksum & compress lists in the --version output.

commit fc265c5a927466172dc01593be86becfc46913b8
Author: Wayne Davison <wayne at opencoder.net>
Date:   Mon May 25 11:50:44 2020 -0700

    A couple minor configure.ac tweaks.

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

Summary of changes:
 compat.c     | 59 +++++++++++++++++++++++++++++++++++++++++++++--------------
 configure.ac |  6 ++----
 options.c    | 11 +++++++++++
 token.c      |  8 ++++----
 4 files changed, 62 insertions(+), 22 deletions(-)


Changeset truncated at 500 lines:

diff --git a/compat.c b/compat.c
index d35a3f98..e89fac26 100644
--- a/compat.c
+++ b/compat.c
@@ -334,10 +334,52 @@ static void recv_negotiate_str(int f_in, struct name_num_obj *nno, char *tmpbuf,
 	exit_cleanup(RERR_UNSUPPORTED);
 }
 
+/* The saw buffer is initialized and used to store ordinal values from 1 to N
+ * for the order of the args in the array.  If dup_markup == '\0', duplicates
+ * are removed otherwise the char is prefixed to the duplicate term and, if it
+ * is an opening paren/bracket/brace, the matching closing char is suffixed. */
+int get_default_nno_list(struct name_num_obj *nno, char *to_buf, int to_buf_len, char dup_markup)
+{
+	struct name_num_item *nni;
+	int len = 0, cnt = 0;
+	char pre_char = '\0', post_char = '\0';
+
+	init_nno_saw(nno, 0);
+
+	for (nni = nno->list, len = 0; nni->name; nni++) {
+		if (nni->main_name) {
+			if (!dup_markup)
+				continue;
+			pre_char = dup_markup;
+			switch (pre_char) {
+			case '(': post_char = ')'; break;
+			case '[': post_char = ']'; break;
+			case '{': post_char = '}'; break;
+			default: break;
+			}
+		}
+		if (len)
+			to_buf[len++]= ' ';
+		if (pre_char) {
+			to_buf[len++]= pre_char;
+			pre_char = '\0';
+		}
+		len += strlcpy(to_buf+len, nni->name, to_buf_len - len);
+		if (len >= to_buf_len - 3)
+			exit_cleanup(RERR_UNSUPPORTED); /* IMPOSSIBLE... */
+		if (post_char) {
+			to_buf[len++]= post_char;
+			post_char = '\0';
+		}
+		nno->saw[nni->num] = ++cnt;
+	}
+
+	return len;
+}
+
 static void send_negotiate_str(int f_out, struct name_num_obj *nno, const char *env_name)
 {
 	char tmpbuf[MAX_NSTR_STRLEN];
-	struct name_num_item *nni;
 	const char *list_str = getenv(env_name);
 	int len, fail_if_empty = list_str && strstr(list_str, "FAIL");
 
@@ -349,9 +391,8 @@ static void send_negotiate_str(int f_out, struct name_num_obj *nno, const char *
 		return;
 	}
 
-	init_nno_saw(nno, 0);
-
 	if (list_str && *list_str && (!am_server || local_server)) {
+		init_nno_saw(nno, 0);
 		len = parse_nni_str(nno, list_str, tmpbuf, MAX_NSTR_STRLEN);
 		if (fail_if_empty && !len)
 			len = strlcpy(tmpbuf, "FAIL", MAX_NSTR_STRLEN);
@@ -360,17 +401,7 @@ static void send_negotiate_str(int f_out, struct name_num_obj *nno, const char *
 		list_str = NULL;
 
 	if (!list_str || !*list_str) {
-		int cnt = 0;
-		for (nni = nno->list, len = 0; nni->name; nni++) {
-			if (nni->main_name)
-				continue;
-			if (len)
-				tmpbuf[len++]= ' ';
-			len += strlcpy(tmpbuf+len, nni->name, MAX_NSTR_STRLEN - len);
-			if (len >= (int)MAX_NSTR_STRLEN - 1)
-				exit_cleanup(RERR_UNSUPPORTED); /* IMPOSSIBLE... */
-			nno->saw[nni->num] = ++cnt;
-		}
+		len = get_default_nno_list(nno, tmpbuf, sizeof tmpbuf, '\0');
 	}
 
 	if (DEBUG_GTE(NSTR, am_server ? 3 : 2)) {
diff --git a/configure.ac b/configure.ac
index e22e17e9..cbf93056 100644
--- a/configure.ac
+++ b/configure.ac
@@ -391,8 +391,7 @@ AH_TEMPLATE([USE_OPENSSL],
 [Undefine if you do not want to use openssl crypto library.  By default this is defined.])
 if test x"$enable_openssl" != x"no" && test x"$ac_cv_header_openssl_md4_h" = x"yes" && test x"$ac_cv_header_openssl_md5_h" = x"yes"; then
     AC_MSG_RESULT(yes)
-    AC_SEARCH_LIBS(MD5_Init, crypto)
-    AC_DEFINE(USE_OPENSSL)
+    AC_SEARCH_LIBS(MD5_Init, crypto, [AC_DEFINE(USE_OPENSSL)])
 else
     AC_MSG_RESULT(no)
 fi
@@ -404,8 +403,7 @@ AH_TEMPLATE([SUPPORT_XXHASH],
 [Undefine if you do not want xxhash checksums.  By default this is defined.])
 if test x"$enable_xxhash" != x"no" && test x"$ac_cv_header_xxhash_h" = x"yes"; then
     AC_MSG_RESULT(yes)
-    AC_SEARCH_LIBS(XXH64_createState, xxhash)
-    AC_DEFINE(SUPPORT_XXHASH)
+    AC_SEARCH_LIBS(XXH64_createState, xxhash, [AC_DEFINE(SUPPORT_XXHASH)])
 else
     AC_MSG_RESULT(no)
 fi
diff --git a/options.c b/options.c
index 5f3b8d92..5b55dbc9 100644
--- a/options.c
+++ b/options.c
@@ -29,6 +29,8 @@ extern int local_server;
 extern int sanitize_paths;
 extern int daemon_over_rsh;
 extern unsigned int module_dirlen;
+extern struct name_num_obj valid_checksums;
+extern struct name_num_obj valid_compressions;
 extern filter_rule_list filter_list;
 extern filter_rule_list daemon_filter_list;
 
@@ -566,6 +568,7 @@ void negate_output_levels(void)
 
 static void print_rsync_version(enum logcode f)
 {
+	char tmpbuf[256];
 	char *subprotocol = "";
 	char const *got_socketpair = "no ";
 	char const *have_inplace = "no ";
@@ -637,6 +640,14 @@ static void print_rsync_version(enum logcode f)
 	rprintf(f, "    %sappend, %sACLs, %sxattrs, %siconv, %ssymtimes, %sprealloc, %sSIMD, %sxxhash\n",
 		have_inplace, acls, xattrs, iconv, symtimes, prealloc, simd, xxhash);
 
+	rprintf(f,"\n");
+	
+	get_default_nno_list(&valid_checksums, tmpbuf, sizeof tmpbuf, '(');
+	rprintf(f, "Checksum list: %s\n", tmpbuf);
+
+	get_default_nno_list(&valid_compressions, tmpbuf, sizeof tmpbuf, '(');
+	rprintf(f, "Compress list: %s\n", tmpbuf);
+
 #ifdef MAINTAINER_MODE
 	rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
 #endif
diff --git a/token.c b/token.c
index ca95e014..aa7ed42d 100644
--- a/token.c
+++ b/token.c
@@ -62,15 +62,15 @@ void init_compression_level(void)
 		exit_cleanup(RERR_UNSUPPORTED);
 	}
 
-	if (do_compression_level == off_level) {
+	if (do_compression_level == CLVL_NOT_SPECIFIED)
+		do_compression_level = def_level;
+	else if (do_compression_level == off_level) {
 		do_compression = CPRES_NONE;
 		return;
 	}
 
 	/* We don't bother with any errors or warnings -- just make sure that the values are valid. */
-	if (do_compression_level == CLVL_NOT_SPECIFIED)
-		do_compression_level = def_level;
-	else if (do_compression_level < min_level)
+	if (do_compression_level < min_level)
 		do_compression_level = min_level;
 	else if (do_compression_level > max_level)
 		do_compression_level = max_level;


-- 
The rsync repository.



More information about the rsync-cvs mailing list