diff options
-rw-r--r-- | io.c | 3 | ||||
-rw-r--r-- | main.c | 6 |
2 files changed, 8 insertions, 1 deletions
@@ -912,6 +912,9 @@ void noop_io_until_death(void) { char buf[1024]; + if (!iobuf.in.buf || !iobuf.out.buf || iobuf.in_fd == -1 || iobuf.out_fd == -1) + return; + kluge_around_eof = 2; /* Setting an I/O timeout ensures that if something inexplicably weird * happens, we won't hang around forever. */ @@ -809,8 +809,12 @@ static void do_server_sender(int f_in, int f_out, int argc, char *argv[]) } flist = send_file_list(f_out,argc,argv); - if (!flist || flist->used == 0) + if (!flist || flist->used == 0) { + /* Make sure input buffering is off so we can't hang in noop_io_until_death(). */ + io_end_buffering_in(0); + /* TODO: we should really exit in a more controlled manner. */ exit_cleanup(0); + } io_start_buffering_in(f_in); |