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 /rsync.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 'rsync.c')
-rw-r--r-- | rsync.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -365,11 +365,10 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr, iflags = protocol_version >= 29 ? read_shortint(f_in) : ITEM_TRANSFER | ITEM_MISSING_DATA; - /* Honor the old-style keep-alive indicator. */ - if (protocol_version < 30 - && ndx == cur_flist->used && iflags == ITEM_IS_NEW) { + /* Support the protocol-29 keep-alive style. */ + if (protocol_version < 30 && ndx == cur_flist->used && iflags == ITEM_IS_NEW) { if (am_sender) - maybe_send_keepalive(); + maybe_send_keepalive(time(NULL), True); goto read_loop; } |