diff options
author | Matt Johnston <matt@ucc.asn.au> | 2021-10-11 15:16:54 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2021-10-11 15:16:54 +0800 |
commit | 8e6f73e879cafa592148f8393a546d7f59e41060 (patch) | |
tree | 496ff0caf18cf7feafcd8db26cec3d392cec774c /common-channel.c | |
parent | 7c2470ba3a4623aaec19d3eb02d967d4f74e17c1 (diff) | |
download | dropbear-8e6f73e879cafa592148f8393a546d7f59e41060.tar.gz |
- Remove "flushing" handling for exited processes, it should be
handled by normal file descriptor reads.
- Fix sesscheckclose() handling if a channel was closed before a
process was ever launched
Diffstat (limited to 'common-channel.c')
-rw-r--r-- | common-channel.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/common-channel.c b/common-channel.c index 52fc4f4..03b3312 100644 --- a/common-channel.c +++ b/common-channel.c @@ -154,7 +154,6 @@ static struct Channel* newchannel(unsigned int remotechan, newchan->readfd = FD_UNINIT; newchan->errfd = FD_CLOSED; /* this isn't always set to start with */ newchan->await_open = 0; - newchan->flushing = 0; newchan->writebuf = cbuf_new(opts.recv_window); newchan->recvwindow = opts.recv_window; @@ -284,14 +283,6 @@ static void check_close(struct Channel *channel) { channel->writebuf ? cbuf_getused(channel->writebuf) : 0, channel->extrabuf ? cbuf_getused(channel->extrabuf) : 0)) - if (!channel->flushing - && !channel->sent_close - && channel->type->check_close - && channel->type->check_close(channel)) - { - channel->flushing = 1; - } - /* if a type-specific check_close is defined we will only exit once that has been triggered. this is only used for a server "session" channel, to ensure that the shell has exited (and the exit status @@ -317,22 +308,6 @@ static void check_close(struct Channel *channel) { close_chan_fd(channel, channel->writefd, SHUT_WR); } - /* Special handling for flushing read data after an exit. We - read regardless of whether the select FD was set, - and if there isn't data available, the channel will get closed. */ - if (channel->flushing) { - TRACE(("might send data, flushing")) - if (channel->readfd >= 0 && channel->transwindow > 0) { - TRACE(("send data readfd")) - send_msg_channel_data(channel, 0); - } - if (ERRFD_IS_READ(channel) && channel->errfd >= 0 - && channel->transwindow > 0) { - TRACE(("send data errfd")) - send_msg_channel_data(channel, 1); - } - } - /* If we're not going to send any more data, send EOF */ if (!channel->sent_eof && channel->readfd == FD_CLOSED @@ -779,14 +754,6 @@ static void send_msg_channel_data(struct Channel *channel, int isextended) { channel->transwindow -= len; encrypt_packet(); - - /* If we receive less data than we requested when flushing, we've - reached the equivalent of EOF */ - if (channel->flushing && len < (ssize_t)maxlen) - { - TRACE(("closing from channel, flushing out.")) - close_chan_fd(channel, fd, SHUT_RD); - } TRACE(("leave send_msg_channel_data")) } |