summaryrefslogtreecommitdiffhomepage
path: root/common-channel.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2014-02-17 21:41:06 +0800
committerMatt Johnston <matt@ucc.asn.au>2014-02-17 21:41:06 +0800
commitbf6f3f613d487299df5e2570984c22ad72908c28 (patch)
treec8cebde88c618edf76e231cbd0d7c19fade00a2e /common-channel.c
parent0c9a643216e330911917fb1837747456d49a80b2 (diff)
Read (and enqueue) packets from interactive input even when
we're waiting for a key exchange. This should hopefully fix the situation where "~." doesn't work to terminate a client session when a laptop wakes up. The client will be stuck waiting for a key exchange on a dead connection, so won't have read the escape character
Diffstat (limited to 'common-channel.c')
-rw-r--r--common-channel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/common-channel.c b/common-channel.c
index 2068904..4a6bdb4 100644
--- a/common-channel.c
+++ b/common-channel.c
@@ -474,8 +474,13 @@ void setchannelfds(fd_set *readfds, fd_set *writefds) {
continue;
}
- /* Stuff to put over the wire */
- if (channel->transwindow > 0) {
+ /* Stuff to put over the wire.
+ Avoid queueing data to send if we're in the middle of a
+ key re-exchange (!dataallowed), but still read from the
+ FD if there's the possibility of "~."" to kill an
+ interactive session (the read_mangler) */
+ if (channel->transwindow > 0
+ && (ses.dataallowed || channel->read_mangler)) {
if (channel->readfd >= 0) {
FD_SET(channel->readfd, readfds);