aboutsummaryrefslogtreecommitdiffstats
path: root/sender.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2007-02-16 02:35:31 +0000
committerWayne Davison <wayned@samba.org>2007-02-16 02:35:31 +0000
commitbe91bd81b8cf3579e1e9e4af39a51eb44ee8a636 (patch)
tree1f7b6c0d463ad43ef9714e2357b84d32cc036582 /sender.c
parent2a40b503c06afff55ea6b3e6d3f760e8ef58c7f3 (diff)
downloadandroid_external_rsync-be91bd81b8cf3579e1e9e4af39a51eb44ee8a636.tar.gz
android_external_rsync-be91bd81b8cf3579e1e9e4af39a51eb44ee8a636.tar.bz2
android_external_rsync-be91bd81b8cf3579e1e9e4af39a51eb44ee8a636.zip
Improved the incremental sending of file lists in two ways: (1)
when the sender gets an index of a file to send, we make sure to send enough future file-list data relative to the new cur_flist value before we send the data for the file transfer (ensuring that the generator gets the data in a more timely manner), and (2) the generator flushes the output socket after each file-list object has completed its scan so that the sender knows in a more timely manner that more list data is needed.
Diffstat (limited to 'sender.c')
-rw-r--r--sender.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sender.c b/sender.c
index 0954218d..cab7e235 100644
--- a/sender.c
+++ b/sender.c
@@ -44,6 +44,8 @@ extern int write_batch;
extern struct stats stats;
extern struct file_list *cur_flist, *first_flist;
+#define FILECNT_LOOKAHEAD 1000
+
/**
* @file
*
@@ -180,7 +182,7 @@ void send_files(int f_in, int f_out)
while (1) {
if (inc_recurse)
- send_extra_file_list(f_out, 1000);
+ send_extra_file_list(f_out, FILECNT_LOOKAHEAD);
/* This call also sets cur_flist. */
ndx = read_ndx_and_attrs(f_in, f_out, &iflags,
@@ -201,6 +203,9 @@ void send_files(int f_in, int f_out)
continue;
}
+ if (inc_recurse)
+ send_extra_file_list(f_out, FILECNT_LOOKAHEAD);
+
file = cur_flist->files[ndx - cur_flist->ndx_start];
if (F_ROOTDIR(file)) {
path = F_ROOTDIR(file);