X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/bcbf86ecce0d10003d08a40b67f2db96702c132a..22d89d24e31f308cfaf0407fd29451f042ebb8d6:/serverloop.c diff --git a/serverloop.c b/serverloop.c index c2b2d022..50e89aee 100644 --- a/serverloop.c +++ b/serverloop.c @@ -110,7 +110,6 @@ sigchld_handler2(int sig) int save_errno = errno; debug("Received SIGCHLD."); child_terminated = 1; - child_has_selected = 0; errno = save_errno; } @@ -389,7 +388,7 @@ drain_output() void process_buffered_input_packets() { - dispatch_run(DISPATCH_NONBLOCK, NULL); + dispatch_run(DISPATCH_NONBLOCK, NULL, NULL); } /* @@ -675,10 +674,10 @@ server_loop2(void) session_close_by_pid(pid, status); child_terminated = 0; signal(SIGCHLD, sigchld_handler2); + if (used_sessions() == 0) + break; } channel_after_select(&readset, &writeset); - if (child_terminated && child_has_selected) - break; process_input(&readset); process_output(&writeset); } @@ -689,7 +688,7 @@ server_loop2(void) } void -server_input_stdin_data(int type, int plen) +server_input_stdin_data(int type, int plen, void *ctxt) { char *data; unsigned int data_len; @@ -706,7 +705,7 @@ server_input_stdin_data(int type, int plen) } void -server_input_eof(int type, int plen) +server_input_eof(int type, int plen, void *ctxt) { /* * Eof from the client. The stdin descriptor to the @@ -719,7 +718,7 @@ server_input_eof(int type, int plen) } void -server_input_window_size(int type, int plen) +server_input_window_size(int type, int plen, void *ctxt) { int row = packet_get_int(); int col = packet_get_int(); @@ -765,7 +764,7 @@ input_direct_tcpip(void) } void -server_input_channel_open(int type, int plen) +server_input_channel_open(int type, int plen, void *ctxt) { Channel *c = NULL; char *ctype; @@ -780,7 +779,7 @@ server_input_channel_open(int type, int plen) rwindow = packet_get_int(); rmaxpack = packet_get_int(); - debug("channel_input_open: ctype %s rchan %d win %d max %d", + debug("server_input_channel_open: ctype %s rchan %d win %d max %d", ctype, rchan, rwindow, rmaxpack); if (strcmp(ctype, "session") == 0) {