From eda15d52a8b07ea09643c3c5fc788f4c33986c3a Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sun, 24 May 2020 02:07:43 -0700 Subject: [PATCH] Make xxh64 the "main_name" for the current xxhash. --- checksum.c | 4 ++-- rsync.yo | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/checksum.c b/checksum.c index 34aef240..1be17522 100644 --- a/checksum.c +++ b/checksum.c @@ -59,8 +59,8 @@ struct csum_struct { const char *name, *main_name; } valid_checksums[] = { #ifdef SUPPORT_XXHASH - { CSUM_XXH64, "xxhash", NULL }, { CSUM_XXH64, "xxh64", NULL }, + { CSUM_XXH64, "xxhash", NULL }, #endif { CSUM_MD5, "md5", NULL }, { CSUM_MD4, "md4", NULL }, @@ -270,7 +270,7 @@ void negotiate_checksum(int f_in, int f_out, const char *csum_list, int fail_if_ if (!cs || !saw[cs->num] || best <= saw[cs->num]) continue; xfersum_type = checksum_type = cs->num; - negotiated_csum_name = cs->name; + negotiated_csum_name = cs->main_name ? cs->main_name : cs->name; best = saw[cs->num]; if (best == 1) break; diff --git a/rsync.yo b/rsync.yo index a7e36423..ff8bca04 100644 --- a/rsync.yo +++ b/rsync.yo @@ -1376,7 +1376,7 @@ and (assuming bf(--checksum) is specified) the pre-transfer checksums. If two comma-separated names are supplied, the first name affects the transfer checksums, and the second name affects the pre-transfer checksums (bf(-c)). -The algorithm choices are "auto", "xxhash", "MD5", "MD4", and "none". +The algorithm choices are "auto", "xxh64" (aka "xxhash"), "MD5", "MD4", and "none". If "none" is specified for the first (or only) name, the bf(--whole-file) option is forced on and no checksum verification is performed on the transferred data. @@ -1389,7 +1389,7 @@ negotation between the client and the server as follows: If both the client and the server are at least version 3.2.0, they will exchange a list of checksum names and choose the first one in the list that they have in common. -This typically means that they will choose xxhash if they both support it +This typically means that they will choose xxh64 if they both support it and fall back to MD5. If one side of the transfer is not new enough to support this checksum negotation, then a value is chosen based on the protocol version (which -- 2.47.2