Add safety check for local --remove-source-files.
[rsync.git] / compat.c
index dec363a6188566053ba0a0df45120394c1502955..622910ebdac908e6fcccf7e85bcb3b95196b88dc 100644 (file)
--- a/compat.c
+++ b/compat.c
@@ -91,19 +91,21 @@ int filesfrom_convert = 0;
 
 #define MAX_NSTR_STRLEN 256
 
-struct name_num_obj valid_compressions = {
-       "compress", NULL, NULL, 0, 0, {
+struct name_num_item valid_compressions_items[] = {
 #ifdef SUPPORT_ZSTD
-               { CPRES_ZSTD, "zstd", NULL },
+       { CPRES_ZSTD, "zstd", NULL },
 #endif
 #ifdef SUPPORT_LZ4
-               { CPRES_LZ4, "lz4", NULL },
+       { CPRES_LZ4, "lz4", NULL },
 #endif
-               { CPRES_ZLIBX, "zlibx", NULL },
-               { CPRES_ZLIB, "zlib", NULL },
-               { CPRES_NONE, "none", NULL },
-               { 0, NULL, NULL }
-       }
+       { CPRES_ZLIBX, "zlibx", NULL },
+       { CPRES_ZLIB, "zlib", NULL },
+       { CPRES_NONE, "none", NULL },
+       { 0, NULL, NULL }
+};
+
+struct name_num_obj valid_compressions = {
+       "compress", NULL, NULL, 0, 0, valid_compressions_items
 };
 
 #define CF_INC_RECURSE  (1<<0)
@@ -523,6 +525,8 @@ static void negotiate_the_strings(int f_in, int f_out)
 {
        /* We send all the negotiation strings before we start to read them to help avoid a slow startup. */
 
+       init_checksum_choices();
+
        if (!checksum_choice)
                send_negotiate_str(f_out, &valid_checksums, NSTR_CHECKSUM);