From: Wayne Davison Date: Thu, 5 Feb 2009 02:07:58 +0000 (-0800) Subject: Ensure that the sender turns off any msg_fd_in use earlier. X-Git-Tag: v3.0.6pre1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9493048c10ba21a5c9095d7e75b61b7c3ee0adab;p=thirdparty%2Frsync.git Ensure that the sender turns off any msg_fd_in use earlier. This avoids a problem where an extra message from the sender could give the generator time to start sending data that will not be understood by the sender's use of read_msg_fd(). --- diff --git a/NEWS b/NEWS index 70245eea..f34330c2 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,9 @@ Changes since 3.0.5: - The sender now skips a (bogus) symlink that has a 0-length value, which avoids a transfer error in the receiver. + - Fixed a case where the sender could die with a tag-0 error if there was + an I/O during the sending of the file list. + - Fixed the rrsync script to avoid a server-side problem when -e is at the start of the short options. diff --git a/flist.c b/flist.c index d296b36f..976f0103 100644 --- a/flist.c +++ b/flist.c @@ -2210,6 +2210,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) if (numeric_ids <= 0 && !inc_recurse) send_id_list(f); + set_msg_fd_in(-1); + /* send the io_error flag */ if (protocol_version < 30) write_int(f, ignore_errors ? 0 : io_error); diff --git a/main.c b/main.c index 23699f68..0774f1fa 100644 --- a/main.c +++ b/main.c @@ -1016,7 +1016,6 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]) if (write_batch && !am_server) start_write_batch(f_out); flist = send_file_list(f_out, argc, argv); - set_msg_fd_in(-1); if (verbose > 3) rprintf(FINFO,"file list sent\n");