]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Some minor tweaks & tidying up.
authorWayne Davison <wayne@opencoder.net>
Mon, 25 May 2020 05:31:28 +0000 (22:31 -0700)
committerWayne Davison <wayne@opencoder.net>
Mon, 25 May 2020 05:50:51 +0000 (22:50 -0700)
batch.c
byteorder.h
checksum.c
compat.c
io.c
lib/mdfour.c

diff --git a/batch.c b/batch.c
index 8915d9e0f3560243bfeec0a8d8bd65cf9399234a..77ad4733fc7b4db7be41ae21ff22029cb52d26bd 100644 (file)
--- a/batch.c
+++ b/batch.c
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 1999 Weiss
  * Copyright (C) 2004 Chris Shoemaker
- * Copyright (C) 2004-2019 Wayne Davison
+ * Copyright (C) 2004-2020 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index 5684d2de6595a1dc79eed235ef8e434fdf02c7ea..525eaba047608e5b2f9c262300bd79f2137f3240 100644 (file)
@@ -2,7 +2,7 @@
  * Simple byteorder handling.
  *
  * Copyright (C) 1992-1995 Andrew Tridgell
- * Copyright (C) 2007-2019 Wayne Davison
+ * Copyright (C) 2007-2020 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index fb771402fab5210baeb609f8b8ce2e6511818ead..bde7c35f493f0d288b902d14715f2ae62175c07b 100644 (file)
@@ -36,9 +36,7 @@
 #endif
 
 extern int am_server;
-extern int local_server;
 extern int whole_file;
-extern int read_batch;
 extern int checksum_seed;
 extern int protocol_version;
 extern int proper_seed_order;
@@ -111,7 +109,9 @@ static const char *checksum_name(int num)
 
 void parse_checksum_choice(int final_call)
 {
-       if (!valid_checksums.negotiated_name) {
+       if (valid_checksums.negotiated_name)
+               xfersum_type = checksum_type = valid_checksums.negotiated_num;
+       else {
                char *cp = checksum_choice ? strchr(checksum_choice, ',') : NULL;
                if (cp) {
                        xfersum_type = parse_csum_name(checksum_choice, cp - checksum_choice);
@@ -132,10 +132,8 @@ void parse_checksum_choice(int final_call)
                                checksum_choice ? "chosen" : "protocol-based",
                                checksum_name(xfersum_type));
                } else {
-                       rprintf(FINFO, "%s chosen transfer checksum: %s\n",
-                               c_s, checksum_name(xfersum_type));
-                       rprintf(FINFO, "%s chosen pre-transfer checksum: %s\n",
-                               c_s, checksum_name(checksum_type));
+                       rprintf(FINFO, "%s chosen transfer checksum: %s\n", c_s, checksum_name(xfersum_type));
+                       rprintf(FINFO, "%s chosen pre-transfer checksum: %s\n", c_s, checksum_name(checksum_type));
                }
        }
 }
index c555732c33c92dc4c390d69a38724613256afa9c..4e2fd4b88786596202433cad36ad97d21fedb43b 100644 (file)
--- a/compat.c
+++ b/compat.c
@@ -47,8 +47,6 @@ extern int preserve_xattrs;
 extern int xfer_flags_as_varint;
 extern int need_messages_from_generator;
 extern int delete_mode, delete_before, delete_during, delete_after;
-extern int xfersum_type;
-extern int checksum_type;
 extern int do_compression;
 extern char *shell_cmd;
 extern char *partial_dir;
@@ -256,7 +254,7 @@ static int parse_nni_str(struct name_num_obj *nno, const char *from, char *tobuf
                                struct name_num_item *nni = get_nni_by_name(nno, tok, to - tok);
                                if (nni && !nno->saw[nni->num]) {
                                        nno->saw[nni->num] = ++cnt;
-                                       if (nni->main_name && *nni->main_name) {
+                                       if (nni->main_name) {
                                                to = tok + strlcpy(tok, nni->main_name, tobuf_len - (tok - tobuf));
                                                if (to - tobuf >= tobuf_len) {
                                                        to = tok - 1;
@@ -294,7 +292,7 @@ static void recv_negotiate_str(int f_in, struct name_num_obj *nno, char *tmpbuf,
        if (len < 0)
                len = read_vstring(f_in, tmpbuf, MAX_NSTR_STRLEN);
 
-       if (DEBUG_GTE(NSTR, am_server ? 4 : 2)) {
+       if (DEBUG_GTE(NSTR, am_server ? 3 : 2)) {
                if (am_server)
                        rprintf(FINFO, "Client %s list (on server): %s\n", nno->type, tmpbuf);
                else
@@ -368,7 +366,7 @@ static void send_negotiate_str(int f_out, struct name_num_obj *nno, const char *
                }
        }
 
-       if (DEBUG_GTE(NSTR, am_server ? 4 : 2)) {
+       if (DEBUG_GTE(NSTR, am_server ? 3 : 2)) {
                if (am_server)
                        rprintf(FINFO, "Server %s list (on server): %s\n", nno->type, tmpbuf);
                else
@@ -401,17 +399,11 @@ static void negotiate_the_strings(int f_in, int f_out)
                char tmpbuf[MAX_NSTR_STRLEN];
                recv_negotiate_str(f_in, &valid_checksums, tmpbuf, -1);
        }
-       if (valid_checksums.negotiated_name)
-               xfersum_type = checksum_type = valid_checksums.negotiated_num;
 
        if (valid_compressions.saw) {
                char tmpbuf[MAX_NSTR_STRLEN];
                recv_negotiate_str(f_in, &valid_compressions, tmpbuf, -1);
        }
-#if 0
-       if (valid_compressions.negotiated_name)
-               compress_type = valid_checksums.negotiated_num;
-#endif
 }
 
 void setup_protocol(int f_out,int f_in)
diff --git a/io.c b/io.c
index 021330fb3044f7c3a5a0f12b0c2133d679f883ab..ecab460a93fde22aace4e7ded62e372407396c9e 100644 (file)
--- a/io.c
+++ b/io.c
@@ -4,7 +4,7 @@
  * Copyright (C) 1996-2001 Andrew Tridgell
  * Copyright (C) 1996 Paul Mackerras
  * Copyright (C) 2001, 2002 Martin Pool <mbp@samba.org>
- * Copyright (C) 2003-2019 Wayne Davison
+ * Copyright (C) 2003-2020 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index 70a8ba34d86bb34660f675a3f861e00c7385f89f..6203658d53761b01a16789f443ef1f6c2c1a6bae 100644 (file)
@@ -4,7 +4,7 @@
  * An implementation of MD4 designed for use in the SMB authentication protocol.
  *
  * Copyright (C) 1997-1998 Andrew Tridgell
- * Copyright (C) 2005-2019 Wayne Davison
+ * Copyright (C) 2005-2020 Wayne Davison
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by