diff options
author | Matt Johnston <matt@ucc.asn.au> | 2007-02-12 10:39:22 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2007-02-12 10:39:22 +0000 |
commit | 1587f1945b8470ca79a2585029c01b5123596e57 (patch) | |
tree | c9126875cf6da396366d8ab83c641086f55b38b1 /common-channel.c | |
parent | 4f772496e5b161d20f7044a3bc02408e6e28e987 (diff) | |
download | dropbear-1587f1945b8470ca79a2585029c01b5123596e57.tar.gz |
- Fix bug in child-exit handling where the wrong pid was being matched.
- Also wait for errfd to close before closing the channel
Diffstat (limited to 'common-channel.c')
-rw-r--r-- | common-channel.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common-channel.c b/common-channel.c index d87ea7d..fdaeb24 100644 --- a/common-channel.c +++ b/common-channel.c @@ -313,6 +313,7 @@ static void check_close(struct Channel *channel) { /* And if we can't receive any more data from them either, close up */ if (!channel->sent_close && channel->readfd == FD_CLOSED + && (ERRFD_IS_WRITE(channel) || channel->errfd == FD_CLOSED) && !write_pending(channel)) { TRACE(("sending close, readfd is closed")) send_msg_channel_close(channel); @@ -624,8 +625,8 @@ static void send_msg_channel_data(struct Channel *channel, int isextended) { close_chan_fd(channel, fd, SHUT_RD); } ses.writepayload->len = ses.writepayload->pos = 0; - TRACE(("leave send_msg_channel_data: len %d read err or EOF for fd %d", - len, channel->index)); + TRACE(("leave send_msg_channel_data: len %d read err %d or EOF for fd %d", + len, errno, fd)) return; } buf_incrwritepos(ses.writepayload, len); |