From 07bff66fb5740d91fde22e733ca180f8e9acbb57 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 20 Nov 2004 17:10:54 +0000 Subject: [PATCH] Fixed a socket-data conflict when verbosity is >= 2 and the files-from list is coming from a remote receiver. --- main.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 9c84b071..28803c8b 100644 --- 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); -- 2.34.1