diff options
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/channels.c b/channels.c index 18f667f6b..f03cf92b4 100644 --- a/channels.c +++ b/channels.c | |||
@@ -17,7 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include "includes.h" | 19 | #include "includes.h" |
20 | RCSID("$Id: channels.c,v 1.21 2000/04/04 04:39:00 damien Exp $"); | 20 | RCSID("$Id: channels.c,v 1.22 2000/04/06 02:32:38 damien Exp $"); |
21 | 21 | ||
22 | #include "ssh.h" | 22 | #include "ssh.h" |
23 | #include "packet.h" | 23 | #include "packet.h" |
@@ -642,6 +642,7 @@ channel_handle_efd(Channel *c, fd_set * readset, fd_set * writeset) | |||
642 | char buf[16*1024]; | 642 | char buf[16*1024]; |
643 | int len; | 643 | int len; |
644 | 644 | ||
645 | /** XXX handle drain efd, too */ | ||
645 | if (c->efd != -1) { | 646 | if (c->efd != -1) { |
646 | if (c->extended_usage == CHAN_EXTENDED_WRITE && | 647 | if (c->extended_usage == CHAN_EXTENDED_WRITE && |
647 | FD_ISSET(c->efd, writeset) && | 648 | FD_ISSET(c->efd, writeset) && |
@@ -659,7 +660,12 @@ channel_handle_efd(Channel *c, fd_set * readset, fd_set * writeset) | |||
659 | len = read(c->efd, buf, sizeof(buf)); | 660 | len = read(c->efd, buf, sizeof(buf)); |
660 | debug("channel %d: read %d from efd %d", | 661 | debug("channel %d: read %d from efd %d", |
661 | c->self, len, c->efd); | 662 | c->self, len, c->efd); |
662 | if (len > 0) | 663 | if (len == 0) { |
664 | debug("channel %d: closing efd %d", | ||
665 | c->self, c->efd); | ||
666 | close(c->efd); | ||
667 | c->efd = -1; | ||
668 | } else if (len > 0) | ||
663 | buffer_append(&c->extended, buf, len); | 669 | buffer_append(&c->extended, buf, len); |
664 | } | 670 | } |
665 | } | 671 | } |