extern int protocol_version;
extern int fuzzy_basis;
extern int always_checksum;
-@@ -95,6 +94,11 @@ extern struct filter_list_struct server_
+@@ -98,6 +97,11 @@ int non_perishable_cnt = 0;
static int deletion_count = 0; /* used to implement --max-delete */
+static int GEN_make_backups;
+static int GEN_csum_length;
+
- /* For calling delete_item() */
+ /* For calling delete_item() and delete_dir_contents(). */
#define DEL_RECURSE (1<<1) /* recurse */
-
-@@ -477,8 +481,8 @@ static void sum_sizes_sqroot(struct sum_
+ #define DEL_DIR_IS_EMPTY (1<<2) /* internal delete_FUNCTIONS use only */
+@@ -508,8 +512,8 @@ static void sum_sizes_sqroot(struct sum_
}
if (protocol_version < 27) {
s2length = SUM_LENGTH;
} else {
int32 c;
-@@ -488,7 +492,7 @@ static void sum_sizes_sqroot(struct sum_
+@@ -519,7 +523,7 @@ static void sum_sizes_sqroot(struct sum_
for (c = blength; (c >>= 1) && b; b--) {}
/* add a bit, subtract rollsum, round up. */
s2length = (b + 1 - 32 + 7) / 8; /* --optimize in compiler-- */
s2length = MIN(s2length, SUM_LENGTH);
}
-@@ -522,7 +526,7 @@ static void generate_and_send_sums(int f
+@@ -553,7 +557,7 @@ static void generate_and_send_sums(int f
sum_sizes_sqroot(&sum, len);
write_sum_head(f_out, &sum);
return;
if (len > 0)
-@@ -541,7 +545,7 @@ static void generate_and_send_sums(int f
+@@ -572,7 +576,7 @@ static void generate_and_send_sums(int f
if (f_copy >= 0) {
full_write(f_copy, map, n1);
continue;
}
-@@ -1316,7 +1320,7 @@ static void recv_generator(char *fname,
+@@ -1347,7 +1351,7 @@ static void recv_generator(char *fname,
return;
}
return;
if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
-@@ -1379,7 +1383,7 @@ static void recv_generator(char *fname,
+@@ -1410,7 +1414,7 @@ static void recv_generator(char *fname,
goto notify_others;
}
if (!(backupptr = get_backup_name(fname))) {
close(fd);
return;
-@@ -1470,9 +1474,12 @@ void generate_files(int f_out, struct fi
+@@ -1501,9 +1505,12 @@ void generate_files(int f_out, struct fi
int save_ignore_existing = ignore_existing;
int save_ignore_non_existing = ignore_non_existing;
int save_do_progress = do_progress;
if (protocol_version >= 29) {
itemizing = 1;
maybe_ATTRS_REPORT = stdout_format_has_i ? 0 : ATTRS_REPORT;
-@@ -1500,7 +1507,7 @@ void generate_files(int f_out, struct fi
+@@ -1531,7 +1538,7 @@ void generate_files(int f_out, struct fi
do_delete_pass(flist);
do_progress = 0;
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -1509,12 +1516,6 @@ void generate_files(int f_out, struct fi
+@@ -1540,12 +1547,6 @@ void generate_files(int f_out, struct fi
: "enabled");
}
for (i = 0; i < flist->count; i++) {
struct file_struct *file = flist->files[i];
-@@ -1558,23 +1559,34 @@ void generate_files(int f_out, struct fi
+@@ -1589,23 +1590,34 @@ void generate_files(int f_out, struct fi
delete_in_dir(NULL, NULL, NULL, NULL);
phase++;
if (local_name)
strlcpy(fbuf, local_name, sizeof fbuf);
else
-@@ -1586,27 +1598,43 @@ void generate_files(int f_out, struct fi
+@@ -1617,27 +1629,43 @@ void generate_files(int f_out, struct fi
phase++;
ignore_non_existing = save_ignore_non_existing;
ignore_existing = save_ignore_existing;