|
Lines 711-717
Link Here
|
| 711 |
} |
711 |
} |
| 712 |
/** XXX check close conditions, too */ |
712 |
/** XXX check close conditions, too */ |
| 713 |
if (compat20 && c->efd != -1) { |
713 |
if (compat20 && c->efd != -1) { |
| 714 |
if (c->extended_usage == CHAN_EXTENDED_WRITE && |
714 |
if (c->ostate != CHAN_OUTPUT_CLOSED && |
|
|
715 |
c->extended_usage == CHAN_EXTENDED_WRITE && |
| 715 |
buffer_len(&c->extended) > 0) |
716 |
buffer_len(&c->extended) > 0) |
| 716 |
FD_SET(c->efd, writeset); |
717 |
FD_SET(c->efd, writeset); |
| 717 |
else if (c->extended_usage == CHAN_EXTENDED_READ && |
718 |
else if (c->extended_usage == CHAN_EXTENDED_READ && |
|
Lines 1562-1567
Link Here
|
| 1562 |
channel_handler(channel_post, readset, writeset); |
1563 |
channel_handler(channel_post, readset, writeset); |
| 1563 |
} |
1564 |
} |
| 1564 |
|
1565 |
|
|
|
1566 |
#define CHANNEL_EFD_ALIVE(c) \ |
| 1567 |
(compat20 && c->extended_usage == CHAN_EXTENDED_READ && \ |
| 1568 |
(c->efd != -1 || buffer_len(&c->extended) > 0)) |
| 1569 |
|
| 1565 |
|
1570 |
|
| 1566 |
/* If there is data to send to the connection, enqueue some of it now. */ |
1571 |
/* If there is data to send to the connection, enqueue some of it now. */ |
| 1567 |
|
1572 |
|
|
Lines 1634-1639
Link Here
|
| 1634 |
* input-buffer is empty and read-socket shutdown: |
1639 |
* input-buffer is empty and read-socket shutdown: |
| 1635 |
* tell peer, that we will not send more data: send IEOF |
1640 |
* tell peer, that we will not send more data: send IEOF |
| 1636 |
*/ |
1641 |
*/ |
|
|
1642 |
if (CHANNEL_EFD_ALIVE(c)) |
| 1643 |
debug2("channel %d: ibuf_empty delayed efd %d/(%d)", |
| 1644 |
c->self, c->efd, buffer_len(&c->extended)); |
| 1645 |
else |
| 1637 |
chan_ibuf_empty(c); |
1646 |
chan_ibuf_empty(c); |
| 1638 |
} |
1647 |
} |
| 1639 |
/* Send extended data, i.e. stderr */ |
1648 |
/* Send extended data, i.e. stderr */ |
|
Lines 1725-1730
Link Here
|
| 1725 |
if (c->type != SSH_CHANNEL_OPEN) { |
1734 |
if (c->type != SSH_CHANNEL_OPEN) { |
| 1726 |
log("channel %d: ext data for non open", id); |
1735 |
log("channel %d: ext data for non open", id); |
| 1727 |
return; |
1736 |
return; |
|
|
1737 |
} |
| 1738 |
if (c->ostate == CHAN_OUTPUT_CLOSED) { |
| 1739 |
if (c->flags & CHAN_WRITE_FAILED) { |
| 1740 |
debug3("channel %d: ignoring ext data", c->self); |
| 1741 |
return; |
| 1742 |
} |
| 1743 |
packet_disconnect( |
| 1744 |
"Received extended_data after EOF on channel %d.", id); |
| 1728 |
} |
1745 |
} |
| 1729 |
tcode = packet_get_int(); |
1746 |
tcode = packet_get_int(); |
| 1730 |
if (c->efd == -1 || |
1747 |
if (c->efd == -1 || |