Fixed a socket-data conflict when verbosity is >= 2 and the
authorWayne Davison <wayned@samba.org>
Sat, 20 Nov 2004 17:10:54 +0000 (17:10 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 20 Nov 2004 17:10:54 +0000 (17:10 +0000)
files-from list is coming from a remote receiver.

main.c

diff --git a/main.c b/main.c
index 9c84b07..28803c8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -562,6 +562,13 @@ static void do_server_recv(int f_in, int f_out, int argc,char *argv[])
        struct file_list *flist;
        char *local_name = NULL;
        char *dir = NULL;
+       int save_verbose = verbose;
+
+       if (filesfrom_fd >= 0) {
+               /* We can't mix messages with files-from data on the socket,
+                * so temporarily turn off verbose messages. */
+               verbose = 0;
+       }
 
        if (verbose > 2) {
                rprintf(FINFO, "server_recv(%d) starting pid=%ld\n",
@@ -591,15 +598,17 @@ static void do_server_recv(int f_in, int f_out, int argc,char *argv[])
                recv_exclude_list(f_in);
 
        if (filesfrom_fd >= 0) {
-               /* We're receiving the file info from the sender, so we need
-                * the IO routines to automatically write out the names onto
-                * our f_out socket as we read the list info from the sender.
-                * This avoids both deadlock and extra delays/buffers. */
+               /* We need to send the files-from names to the sender at the
+                * same time that we receive the file-list from them, so we
+                * need the IO routines to automatically write out the names
+                * onto our f_out socket as we read the file-list.  This
+                * avoids both deadlock and extra delays/buffers. */
                io_set_filesfrom_fds(filesfrom_fd, f_out);
                filesfrom_fd = -1;
        }
 
        flist = recv_file_list(f_in);
+       verbose = save_verbose;
        if (!flist) {
                rprintf(FERROR,"server_recv: recv_file_list error\n");
                exit_cleanup(RERR_FILESELECT);