diff options
author | Wayne Davison <wayned@samba.org> | 2009-12-19 10:15:15 -0800 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2009-12-19 11:00:36 -0800 |
commit | 92d021488ec06524f7ed6a527c39f2753f4a9fd2 (patch) | |
tree | 181e28b70b8d47620557f820801b60d4c95f5f6b /sender.c | |
parent | 82b2a31a46d7c94f951b96f61c9935198f0f53f1 (diff) | |
download | android_external_rsync-92d021488ec06524f7ed6a527c39f2753f4a9fd2.tar.gz android_external_rsync-92d021488ec06524f7ed6a527c39f2753f4a9fd2.tar.bz2 android_external_rsync-92d021488ec06524f7ed6a527c39f2753f4a9fd2.zip |
Improve --timeout method to take into account all I/O that is going on.
The receiving side also switches timeout handling from the receiver to
the generator, which obviates the need for the sender to send any
keep-alive messages at all (for protocol 31 and beyond). Given this
setup, all keep-alive messages are now sent as empty MSG_DATA messages,
with MSG_NOOP messages only being understood and (when necessary) acted
upon to forward a keep-alive event to an older receiver. This is both
safer and more compatible with older versions.
Diffstat (limited to 'sender.c')
-rw-r--r-- | sender.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -43,6 +43,7 @@ extern int inplace; extern int batch_fd; extern int write_batch; extern int file_old_total; +extern BOOL we_send_keepalive_messages; extern struct stats stats; extern struct file_list *cur_flist, *first_flist, *dir_flist; @@ -104,8 +105,8 @@ static struct sum_struct *receive_sums(int f) s->sums[i].len = s->blength; offset += s->sums[i].len; - if (allowed_lull && !(i % lull_mod)) - maybe_send_keepalive(); + if (we_send_keepalive_messages && !(i % lull_mod)) + maybe_send_keepalive(time(NULL), True); if (DEBUG_GTE(DELTASUM, 3)) { rprintf(FINFO, |