summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/clientloop.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2001-05-16 21:53:53 +0000
committermarkus <markus@openbsd.org>2001-05-16 21:53:53 +0000
commitec2edb0a9c0fb8bad2e7d1f0cb3b9e61e0039473 (patch)
tree6ccc5b6962f42d94b8c3cd94c9ae0850d0774825 /usr.bin/ssh/clientloop.c
parentMissed conversion of sys___osemctl, sys_omsgctl, sys_oshmctl, to compat_23 (diff)
downloadwireguard-openbsd-ec2edb0a9c0fb8bad2e7d1f0cb3b9e61e0039473.tar.xz
wireguard-openbsd-ec2edb0a9c0fb8bad2e7d1f0cb3b9e61e0039473.zip
check for open sessions before we call select(); fixes the x11 client
bug reported by bowman@math.ualberta.ca
Diffstat (limited to 'usr.bin/ssh/clientloop.c')
-rw-r--r--usr.bin/ssh/clientloop.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c
index ba957fe478c..cea6e77dcee 100644
--- a/usr.bin/ssh/clientloop.c
+++ b/usr.bin/ssh/clientloop.c
@@ -59,7 +59,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: clientloop.c,v 1.70 2001/05/11 14:59:55 markus Exp $");
+RCSID("$OpenBSD: clientloop.c,v 1.71 2001/05/16 21:53:53 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -346,7 +346,13 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
if (buffer_len(&stderr_buffer) > 0)
FD_SET(fileno(stderr), *writesetp);
} else {
- FD_SET(connection_in, *readsetp);
+ /* channel_prepare_select could have closed the last channel */
+ if (session_closed && !channel_still_open()) {
+ if (!packet_have_data_to_write())
+ return;
+ } else {
+ FD_SET(connection_in, *readsetp);
+ }
}
/* Select server connection if have data to write to the server. */