Commit ed7e7955 authored by Wayne Davison's avatar Wayne Davison

Don't try to determine the phase we're in by looking at the value

of csum_length -- it might have been computed to be SUM_LENGTH.
Instead, look at the "phase" variable directly.
parent dec71e94
...@@ -383,7 +383,7 @@ static int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st) ...@@ -383,7 +383,7 @@ static int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
* The block size is a rounded square root of file length. * The block size is a rounded square root of file length.
* *
* The checksum size is determined according to: * The checksum size is determined according to:
* blocksum_bits = BLOCKSUM_EXP + 2*log2(file_len) - log2(block_len) * blocksum_bits = BLOCKSUM_BIAS + 2*log2(file_len) - log2(block_len)
* provided by Donovan Baarda which gives a probability of rsync * provided by Donovan Baarda which gives a probability of rsync
* algorithm corrupting data and falling back using the whole md4 * algorithm corrupting data and falling back using the whole md4
* checksums. * checksums.
...@@ -568,6 +568,8 @@ void check_for_finished_hlinks(int itemizing, enum logcode code) ...@@ -568,6 +568,8 @@ void check_for_finished_hlinks(int itemizing, enum logcode code)
} }
} }
static int phase = 0;
/* Acts on the_file_list->file's ndx'th item, whose name is fname. If a dir, /* Acts on the_file_list->file's ndx'th item, whose name is fname. If a dir,
* make sure it exists, and has the right permissions/timestamp info. For * make sure it exists, and has the right permissions/timestamp info. For
* all other non-regular files (symlinks, etc.) we create them here. For * all other non-regular files (symlinks, etc.) we create them here. For
...@@ -707,7 +709,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, ...@@ -707,7 +709,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
if (set_perms(fname, file, statret ? NULL : &st, 0) if (set_perms(fname, file, statret ? NULL : &st, 0)
&& verbose && code && f_out != -1) && verbose && code && f_out != -1)
rprintf(code, "%s/\n", safe_fname(fname)); rprintf(code, "%s/\n", safe_fname(fname));
if (delete_during && f_out != -1 && csum_length != SUM_LENGTH if (delete_during && f_out != -1 && !phase
&& (file->flags & FLAG_DEL_HERE)) && (file->flags & FLAG_DEL_HERE))
delete_in_dir(the_file_list, fname, file); delete_in_dir(the_file_list, fname, file);
return; return;
...@@ -1091,7 +1093,6 @@ void generate_files(int f_out, struct file_list *flist, char *local_name, ...@@ -1091,7 +1093,6 @@ void generate_files(int f_out, struct file_list *flist, char *local_name,
int f_out_name) int f_out_name)
{ {
int i, lull_mod; int i, lull_mod;
int phase = 0;
char fbuf[MAXPATHLEN]; char fbuf[MAXPATHLEN];
int itemizing, maybe_PERMS_REPORT; int itemizing, maybe_PERMS_REPORT;
enum logcode code; enum logcode code;
......
...@@ -605,8 +605,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name, ...@@ -605,8 +605,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name,
send_msg(MSG_SUCCESS, numbuf, 4); send_msg(MSG_SUCCESS, numbuf, 4);
} }
} else if (!recv_ok) { } else if (!recv_ok) {
int msgtype = csum_length == SUM_LENGTH || read_batch ? int msgtype = phase || read_batch ? FERROR : FINFO;
FERROR : FINFO;
if (msgtype == FERROR || verbose) { if (msgtype == FERROR || verbose) {
char *errstr, *redostr, *keptstr; char *errstr, *redostr, *keptstr;
if (!(keep_partial && partialptr) && !inplace) if (!(keep_partial && partialptr) && !inplace)
...@@ -627,7 +626,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name, ...@@ -627,7 +626,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name,
errstr, safe_fname(fname), errstr, safe_fname(fname),
keptstr, redostr); keptstr, redostr);
} }
if (csum_length != SUM_LENGTH) { if (!phase) {
SIVAL(numbuf, 0, i); SIVAL(numbuf, 0, i);
send_msg(MSG_REDO, numbuf, 4); send_msg(MSG_REDO, numbuf, 4);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment