X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/907e6a32a00ace7cf1e96f9c9132f83f4a208430..9541770faf6cdb2851a39fa5feaa067a6e0d751a:/rsync.c diff --git a/rsync.c b/rsync.c index 3d45d01b..cefbe5f4 100644 --- a/rsync.c +++ b/rsync.c @@ -36,6 +36,7 @@ extern int preserve_times; extern int am_root; extern int am_server; extern int am_sender; +extern int am_receiver; extern int am_generator; extern int am_starting_up; extern int allow_8bit_chars; @@ -149,7 +150,7 @@ void setup_iconv(void) * can wrap around to the start, and the xbuf may have its ".size" reduced * (presumably by 1 byte) if the iconv code doesn't have space to store a * multi-byte character at the physical end of the ".buf" (though no reducing - * happens if ".pos" is < 1, since there is no room to wrap around). + * happens if ".pos" is <= 1, since there is no room to wrap around). * * If ICB_EXPAND_OUT is set in "flags", the "out" xbuf will be allocated if * empty, and (as long as ICB_CIRCULAR_OUT is not set) expanded if too small. @@ -364,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), MSK_ALLOW_FLUSH); goto read_loop; } @@ -719,5 +719,8 @@ const char *who_am_i(void) { if (am_starting_up) return am_server ? "server" : "client"; - return am_sender ? "sender" : am_generator ? "generator" : "receiver"; + return am_sender ? "sender" + : am_generator ? "generator" + : am_receiver ? "receiver" + : "Receiver"; /* pre-forked receiver */ }