Mercurial > dropbear
comparison common-channel.c @ 424:db976892c67f channel-fix
merge of 'c387cf9d6b7b1a951efd19476e81a2c2d7ca09a0'
and 'ed68ea8963f7d1fa600f81479e7e211efc5a31bc'
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 12 Feb 2007 10:39:34 +0000 |
parents | b2b67cfcd66e |
children | c216212001fc |
comparison
equal
deleted
inserted
replaced
421:dbb607d72d01 | 424:db976892c67f |
---|---|
311 } | 311 } |
312 | 312 |
313 /* And if we can't receive any more data from them either, close up */ | 313 /* And if we can't receive any more data from them either, close up */ |
314 if (!channel->sent_close | 314 if (!channel->sent_close |
315 && channel->readfd == FD_CLOSED | 315 && channel->readfd == FD_CLOSED |
316 && (ERRFD_IS_WRITE(channel) || channel->errfd == FD_CLOSED) | |
316 && !write_pending(channel)) { | 317 && !write_pending(channel)) { |
317 TRACE(("sending close, readfd is closed")) | 318 TRACE(("sending close, readfd is closed")) |
318 send_msg_channel_close(channel); | 319 send_msg_channel_close(channel); |
319 } | 320 } |
320 } | 321 } |
622 time we expect to receive EAGAIN is when we're flushing a FD, | 623 time we expect to receive EAGAIN is when we're flushing a FD, |
623 in which case it can be treated the same as EOF */ | 624 in which case it can be treated the same as EOF */ |
624 close_chan_fd(channel, fd, SHUT_RD); | 625 close_chan_fd(channel, fd, SHUT_RD); |
625 } | 626 } |
626 ses.writepayload->len = ses.writepayload->pos = 0; | 627 ses.writepayload->len = ses.writepayload->pos = 0; |
627 TRACE(("leave send_msg_channel_data: len %d read err or EOF for fd %d", | 628 TRACE(("leave send_msg_channel_data: len %d read err %d or EOF for fd %d", |
628 len, channel->index)); | 629 len, errno, fd)) |
629 return; | 630 return; |
630 } | 631 } |
631 buf_incrwritepos(ses.writepayload, len); | 632 buf_incrwritepos(ses.writepayload, len); |
632 /* ... real size here */ | 633 /* ... real size here */ |
633 buf_setpos(ses.writepayload, size_pos); | 634 buf_setpos(ses.writepayload, size_pos); |