aboutsummaryrefslogtreecommitdiffstats
path: root/flist.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2009-08-22 08:15:26 -0700
committerWayne Davison <wayned@samba.org>2009-08-22 08:15:26 -0700
commitce827c3e50cd168027a555ec961b6636e5b63e59 (patch)
tree084485323fae104a377f2bc2c59fcb1a9fe6811e /flist.c
parent2523d0cc14365293a6d0ecb4e5191e50d92adaa6 (diff)
downloadandroid_external_rsync-ce827c3e50cd168027a555ec961b6636e5b63e59.tar.gz
android_external_rsync-ce827c3e50cd168027a555ec961b6636e5b63e59.tar.bz2
android_external_rsync-ce827c3e50cd168027a555ec961b6636e5b63e59.zip
Have the sender use dead time to pad out the file list.
Diffstat (limited to 'flist.c')
-rw-r--r--flist.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/flist.c b/flist.c
index 7208efa4..6eb02c7b 100644
--- a/flist.c
+++ b/flist.c
@@ -97,6 +97,7 @@ struct file_list *cur_flist, *first_flist, *dir_flist;
int send_dir_ndx = -1, send_dir_depth = -1;
int flist_cnt = 0; /* how many (non-tmp) file list objects exist */
int file_total = 0; /* total of all active items over all file-lists */
+int file_old_total = 0; /* total of active items that will soon be gone */
int flist_eof = 0; /* all the file-lists are now known */
#define NORMAL_NAME 0
@@ -1905,17 +1906,17 @@ void send_extra_file_list(int f, int at_least)
struct file_list *flist;
int64 start_write;
uint16 prev_flags;
- int old_cnt, save_io_error = io_error;
+ int save_io_error = io_error;
if (flist_eof)
return;
+ if (at_least < 0)
+ at_least = file_total - file_old_total + 1;
+
/* Keep sending data until we have the requested number of
* files in the upcoming file-lists. */
- old_cnt = cur_flist->used;
- for (flist = first_flist; flist != cur_flist; flist = flist->next)
- old_cnt += flist->used;
- while (file_total - old_cnt < at_least) {
+ while (file_total - file_old_total < at_least) {
struct file_struct *file = dir_flist->sorted[send_dir_ndx];
int dir_ndx, dstart = stats.num_dirs;
const char *pathname = F_PATHNAME(file);