From 7a2fa0c2d3ffa9288140b738b65e4eabb7e596c2 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 30 Jan 2007 03:57:45 +0000 Subject: [PATCH] Changed how send_extra_file_list() checks if we have enough future work. --- flist.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/flist.c b/flist.c index 0834fe71..a0c534f3 100644 --- a/flist.c +++ b/flist.c @@ -1278,16 +1278,20 @@ void send_extra_file_list(int f, int at_least) char fbuf[MAXPATHLEN]; struct file_list *flist; int64 start_write; - int past_and_present, save_io_error = io_error; + int future_cnt, save_io_error = io_error; if (send_dir_ndx < 0) return; /* Keep sending data until we have the requested number of * files in the upcoming file-lists. */ - past_and_present = cur_flist->ndx_start - first_flist->ndx_start - + cur_flist->count; - while (file_total - past_and_present < at_least) { + if (cur_flist->next) { + flist = first_flist->prev; /* the newest flist */ + future_cnt = flist->count + + flist->ndx_start - cur_flist->next->ndx_start; + } else + future_cnt = 0; + while (future_cnt < at_least) { struct file_struct *file = dir_flist->files[send_dir_ndx]; int32 *dp; int dlen; @@ -1310,6 +1314,7 @@ void send_extra_file_list(int f, int at_least) clean_flist(flist, 0, 0); file_total += flist->count; + future_cnt += flist->count; stats.flist_size += stats.total_written - start_write; stats.num_files += flist->count; if (verbose > 3) -- 2.34.1