diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2002-01-21 23:27:11 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2002-01-21 23:27:11 +0000 |
commit | f2e1b320ba2ffa0146776577b360f825362da816 (patch) | |
tree | 85ccd6cb403c8544a049d9cc08645f31719212b5 /usr.bin | |
parent | f3494154e4e97b1ca8041f740f420d99a1c01225 (diff) |
cleanup channels faster if the are empty and we are in drain-state; ok deraadt@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/channels.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/nchan.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index 6fa9093b902..5b2c8b0b9ca 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.160 2002/01/16 13:17:51 markus Exp $"); +RCSID("$OpenBSD: channels.c,v 1.161 2002/01/21 23:27:10 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -1793,6 +1793,8 @@ channel_input_ieof(int type, u_int32_t seq, void *ctxt) if (c->force_drain && c->istate == CHAN_INPUT_OPEN) { debug("channel %d: FORCE input drain", c->self); c->istate = CHAN_INPUT_WAIT_DRAIN; + if (buffer_len(&c->input) == 0) + chan_ibuf_empty(c); } } diff --git a/usr.bin/ssh/nchan.c b/usr.bin/ssh/nchan.c index fd005604fca..8153abbca09 100644 --- a/usr.bin/ssh/nchan.c +++ b/usr.bin/ssh/nchan.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: nchan.c,v 1.43 2002/01/14 13:57:03 markus Exp $"); +RCSID("$OpenBSD: nchan.c,v 1.44 2002/01/21 23:27:10 markus Exp $"); #include "ssh1.h" #include "ssh2.h" @@ -364,6 +364,9 @@ chan_rcvd_ieof(Channel *c) chan_rcvd_eof2(c); else chan_rcvd_ieof1(c); + if (c->ostate == CHAN_OUTPUT_WAIT_DRAIN && + buffer_len(&c->output) == 0) + chan_obuf_empty(c); } void chan_rcvd_oclose(Channel *c) |