Ensure that the sender turns off any msg_fd_in use earlier.
authorWayne Davison <wayned@samba.org>
Thu, 5 Feb 2009 02:14:15 +0000 (18:14 -0800)
committerWayne Davison <wayned@samba.org>
Thu, 5 Feb 2009 02:23:59 +0000 (18:23 -0800)
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().

flist.c
main.c

diff --git a/flist.c b/flist.c
index 1fa2cac..0fc7851 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -2262,6 +2262,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 ec2e43a..2ef2f47 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1091,7 +1091,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 (DEBUG_GTE(FLIST, 3))
                        rprintf(FINFO,"file list sent\n");