From da3478b2a7b0a15f9815dbc3463b98e7249422cc Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 17 Jul 2004 15:19:54 +0000 Subject: [PATCH] - Got rid of the arg to the io_start_multiplex_{in,out}() calls. - Call io_set_sock_fds(). --- clientserver.c | 8 +++++--- main.c | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/clientserver.c b/clientserver.c index a8104839..c690dba2 100644 --- a/clientserver.c +++ b/clientserver.c @@ -198,7 +198,7 @@ int start_inband_exchange(char *user, char *path, int f_in, int f_out, if (protocol_version < 23) { if (protocol_version == 22 || !am_sender) - io_start_multiplex_in(f_in); + io_start_multiplex_in(); } return 0; @@ -450,13 +450,13 @@ static int rsync_module(int f_in, int f_out, int i) if (protocol_version < 23 && (protocol_version == 22 || am_sender)) - io_start_multiplex_out(f_out); + io_start_multiplex_out(); else if (!ret) { /* We have to get I/O multiplexing started so that we can * get the error back to the client. This means getting * the protocol setup finished first in later versions. */ setup_protocol(f_out, f_in); - io_start_multiplex_out(f_out); + io_start_multiplex_out(); } if (!ret) { @@ -497,6 +497,8 @@ int start_daemon(int f_in, int f_out) char *motd; int i = -1; + io_set_sock_fds(f_in, f_out); + if (!lp_load(config_file, 0)) exit_cleanup(RERR_SYNTAX); diff --git a/main.c b/main.c index a94dfe8f..c41e2245 100644 --- a/main.c +++ b/main.c @@ -425,8 +425,9 @@ static void do_server_sender(int f_in, int f_out, int argc,char *argv[]) exit_cleanup(0); } - io_start_buffering_in(f_in); - io_start_buffering_out(f_out); + io_start_buffering_in(); + io_start_buffering_out(); + send_files(flist,f_out,f_in); io_flush(FULL_FLUSH); report(f_out); @@ -494,7 +495,7 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) if (f_in != f_out) close(f_in); - io_start_buffering_out(f_out); + io_start_buffering_out(); set_msg_fd_in(error_pipe[0]); @@ -546,7 +547,7 @@ static void do_server_recv(int f_in, int f_out, int argc,char *argv[]) } } - io_start_buffering_in(f_in); + io_start_buffering_in(); if (delete_mode && !delete_excluded) recv_exclude_list(f_in); @@ -588,13 +589,14 @@ int child_main(int argc, char *argv[]) void start_server(int f_in, int f_out, int argc, char *argv[]) { - setup_protocol(f_out, f_in); - set_nonblocking(f_in); set_nonblocking(f_out); + io_set_sock_fds(f_in, f_out); + setup_protocol(f_out, f_in); + if (protocol_version >= 23) - io_start_multiplex_out(f_out); + io_start_multiplex_out(); if (am_sender) { keep_dirlinks = 0; /* Must be disabled on the sender. */ @@ -635,14 +637,15 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]) set_nonblocking(f_out); } + io_set_sock_fds(f_in, f_out); setup_protocol(f_out,f_in); if (protocol_version >= 23 && !read_batch) - io_start_multiplex_in(f_in); + io_start_multiplex_in(); if (am_sender) { keep_dirlinks = 0; /* Must be disabled on the sender. */ - io_start_buffering_out(f_out); + io_start_buffering_out(); if (cvs_exclude) add_cvs_excludes(); if (delete_mode && !delete_excluded) -- 2.34.1