=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/clientloop.c,v retrieving revision 1.65.2.1 retrieving revision 1.65.2.2 diff -u -r1.65.2.1 -r1.65.2.2 --- src/usr.bin/ssh/clientloop.c 2001/09/27 19:03:54 1.65.2.1 +++ src/usr.bin/ssh/clientloop.c 2001/11/15 00:15:19 1.65.2.2 @@ -59,7 +59,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.65.2.1 2001/09/27 19:03:54 jason Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.65.2.2 2001/11/15 00:15:19 miod Exp $"); #include "ssh.h" #include "ssh1.h" @@ -343,9 +343,12 @@ FD_SET(fileno(stderr), *writesetp); } else { /* channel_prepare_select could have closed the last channel */ - if (session_closed && !channel_still_open()) { - if (!packet_have_data_to_write()) - return; + if (session_closed && !channel_still_open() && + !packet_have_data_to_write()) { + /* clear mask since we did not call select() */ + memset(*readsetp, 0, *maxfdp); + memset(*writesetp, 0, *maxfdp); + return; } else { FD_SET(connection_in, *readsetp); } @@ -753,6 +756,7 @@ if (id != session_ident) error("client_channel_closed: id %d != session_ident %d", id, session_ident); + channel_cancel_cleanup(id); session_closed = 1; if (in_raw_mode()) leave_raw_mode();