From: Wayne Davison Date: Fri, 25 Feb 2005 21:56:00 +0000 (+0000) Subject: Accept the new keep-alive (no-op) packet. X-Git-Tag: v2.6.4pre2~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e6cf5d1891caeed1b1e6c446b8723cd33969b06;p=thirdparty%2Frsync.git Accept the new keep-alive (no-op) packet. --- diff --git a/receiver.c b/receiver.c index 1779d175d..fd75e8e95 100644 --- a/receiver.c +++ b/receiver.c @@ -426,6 +426,10 @@ int recv_files(int f_in, struct file_list *flist, char *local_name, } if (i < 0 || i >= flist->count) { + /* Handle the new keep-alive (no-op) packet. */ + if (i == flist->count && protocol_version >= 29 + && read_shortint(f_in) == ITEM_IS_NEW) + continue; rprintf(FERROR,"Invalid file index %d in recv_files (count=%d)\n", i, flist->count); exit_cleanup(RERR_PROTOCOL); diff --git a/sender.c b/sender.c index ca6ae1e38..b745f6f72 100644 --- a/sender.c +++ b/sender.c @@ -167,6 +167,13 @@ void send_files(struct file_list *flist, int f_out, int f_in) } if (i < 0 || i >= flist->count) { + /* Handle the new keep-alive (no-op) packet. */ + if (i == flist->count && protocol_version >= 29 + && read_shortint(f_in) == ITEM_IS_NEW) { + write_int(f_out, i); + write_shortint(f_out, ITEM_IS_NEW); + continue; + } rprintf(FERROR, "Invalid file index %d (count=%d)\n", i, flist->count); exit_cleanup(RERR_PROTOCOL);