=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/clientloop.c,v retrieving revision 1.39.2.5 retrieving revision 1.39.2.6 diff -u -r1.39.2.5 -r1.39.2.6 --- src/usr.bin/ssh/clientloop.c 2001/09/27 00:15:41 1.39.2.5 +++ src/usr.bin/ssh/clientloop.c 2001/11/15 00:14:59 1.39.2.6 @@ -59,7 +59,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.39.2.5 2001/09/27 00:15:41 miod Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.39.2.6 2001/11/15 00:14:59 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();