summaryrefslogtreecommitdiffstats
path: root/channels.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-04-06 12:32:37 +1000
committerDamien Miller <djm@mindrot.org>2000-04-06 12:32:37 +1000
commit1383bd8eb91a8ec9c8d283679faec5925b0ccc42 (patch)
treef71278df6c50983ea3dad850ae79c45c340d9362 /channels.c
parent74a333bbe11f67c59c559e0f424d5945eb438577 (diff)
- OpenBSD CVS update:
- [channels.c] close efd on eof - [clientloop.c compat.c ssh.c sshconnect.c myproposal.h] ssh2 client implementation, interops w/ ssh.com and lsh servers. - [sshconnect.c] missing free. - [authfile.c cipher.c cipher.h packet.c sshconnect.c sshd.c] remove unused argument, split cipher_mask() - [clientloop.c] re-order: group ssh1 vs. ssh2 - Make Redhat spec require openssl >= 0.9.5a
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/channels.c b/channels.c
index 18f667f6..f03cf92b 100644
--- a/channels.c
+++ b/channels.c
@@ -17,7 +17,7 @@
*/
#include "includes.h"
-RCSID("$Id: channels.c,v 1.21 2000/04/04 04:39:00 damien Exp $");
+RCSID("$Id: channels.c,v 1.22 2000/04/06 02:32:38 damien Exp $");
#include "ssh.h"
#include "packet.h"
@@ -642,6 +642,7 @@ channel_handle_efd(Channel *c, fd_set * readset, fd_set * writeset)
char buf[16*1024];
int len;
+/** XXX handle drain efd, too */
if (c->efd != -1) {
if (c->extended_usage == CHAN_EXTENDED_WRITE &&
FD_ISSET(c->efd, writeset) &&
@@ -659,7 +660,12 @@ channel_handle_efd(Channel *c, fd_set * readset, fd_set * writeset)
len = read(c->efd, buf, sizeof(buf));
debug("channel %d: read %d from efd %d",
c->self, len, c->efd);
- if (len > 0)
+ if (len == 0) {
+ debug("channel %d: closing efd %d",
+ c->self, c->efd);
+ close(c->efd);
+ c->efd = -1;
+ } else if (len > 0)
buffer_append(&c->extended, buf, len);
}
}