Commit fe16d9a6 authored by Wayne Davison's avatar Wayne Davison

Fix a hang when dealing with really large numbers of files

in an incremental recursion scan.
parent 23a0d1e2
...@@ -2349,6 +2349,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) ...@@ -2349,6 +2349,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
flist->sorted = flist->files; flist->sorted = flist->files;
flist_sort_and_clean(flist, 0); flist_sort_and_clean(flist, 0);
file_total += flist->used; file_total += flist->used;
file_old_total += flist->used;
if (numeric_ids <= 0 && !inc_recurse) if (numeric_ids <= 0 && !inc_recurse)
send_id_list(f); send_id_list(f);
......
...@@ -42,6 +42,7 @@ extern int make_backups; ...@@ -42,6 +42,7 @@ extern int make_backups;
extern int inplace; extern int inplace;
extern int batch_fd; extern int batch_fd;
extern int write_batch; extern int write_batch;
extern int file_old_total;
extern struct stats stats; extern struct stats stats;
extern struct file_list *cur_flist, *first_flist, *dir_flist; extern struct file_list *cur_flist, *first_flist, *dir_flist;
...@@ -197,8 +198,11 @@ void send_files(int f_in, int f_out) ...@@ -197,8 +198,11 @@ void send_files(int f_in, int f_out)
end_progress(0); end_progress(0);
} }
if (inc_recurse && first_flist) { if (inc_recurse && first_flist) {
file_old_total -= first_flist->used;
flist_free(first_flist); flist_free(first_flist);
if (first_flist) { if (first_flist) {
if (first_flist == cur_flist)
file_old_total = cur_flist->used;
write_ndx(f_out, NDX_DONE); write_ndx(f_out, NDX_DONE);
continue; continue;
} }
......
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