From e08c961083eb56a13e51506ed8a75b184a9d3172 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 18 May 1998 09:34:33 +0000 Subject: [PATCH] handle rsh clients that don't like half-open connections --- main.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/main.c b/main.c index 5a5d5153..bcc292be 100644 --- a/main.c +++ b/main.c @@ -248,29 +248,27 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) io_flush(); if ((pid=do_fork()) == 0) { - close(recv_pipe[1]); - io_close_input(f_in); - if (f_in != f_out) close(f_in); - generate_files(f_out,flist,local_name,recv_pipe[0]); + close(recv_pipe[0]); + if (f_in != f_out) close(f_out); + + recv_files(f_in,flist,local_name,recv_pipe[1]); + if (!am_server) + report(f_in); + + if (verbose > 3) + rprintf(FINFO,"do_recv waiting on %d\n",pid); io_flush(); _exit(0); } - - close(recv_pipe[0]); - if (f_in != f_out) close(f_out); - - recv_files(f_in,flist,local_name,recv_pipe[1]); - if (!am_server) - report(f_in); - - if (verbose > 3) - rprintf(FINFO,"do_recv waiting on %d\n",pid); + close(recv_pipe[1]); + io_close_input(f_in); + if (f_in != f_out) close(f_in); + generate_files(f_out,flist,local_name,recv_pipe[0]); io_flush(); waitpid(pid, &status, 0); - return status; } -- 2.34.1