|
Lines 1494-1500
channel_handle_rfd(Channel *c, fd_set *r
Link Here
|
| 1494 |
if (c->rfd != -1 && (force || FD_ISSET(c->rfd, readset))) { |
1494 |
if (c->rfd != -1 && (force || FD_ISSET(c->rfd, readset))) { |
| 1495 |
errno = 0; |
1495 |
errno = 0; |
| 1496 |
len = read(c->rfd, buf, sizeof(buf)); |
1496 |
len = read(c->rfd, buf, sizeof(buf)); |
| 1497 |
if (len < 0 && (errno == EINTR || (errno == EAGAIN && !force))) |
1497 |
if (len < 0 && (errno == EINTR || |
|
|
1498 |
((errno == EAGAIN || errno == EWOULDBLOCK) && !force))) |
| 1498 |
return 1; |
1499 |
return 1; |
| 1499 |
#ifndef PTY_ZEROREAD |
1500 |
#ifndef PTY_ZEROREAD |
| 1500 |
if (len <= 0) { |
1501 |
if (len <= 0) { |
|
Lines 1565-1571
channel_handle_wfd(Channel *c, fd_set *r
Link Here
|
| 1565 |
c->local_consumed += dlen + 4; |
1566 |
c->local_consumed += dlen + 4; |
| 1566 |
len = write(c->wfd, buf, dlen); |
1567 |
len = write(c->wfd, buf, dlen); |
| 1567 |
xfree(data); |
1568 |
xfree(data); |
| 1568 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
1569 |
if (len < 0 && (errno == EINTR || errno == EAGAIN || |
|
|
1570 |
errno == EWOULDBLOCK)) |
| 1569 |
return 1; |
1571 |
return 1; |
| 1570 |
if (len <= 0) { |
1572 |
if (len <= 0) { |
| 1571 |
if (c->type != SSH_CHANNEL_OPEN) |
1573 |
if (c->type != SSH_CHANNEL_OPEN) |
|
Lines 1583-1589
channel_handle_wfd(Channel *c, fd_set *r
Link Here
|
| 1583 |
#endif |
1585 |
#endif |
| 1584 |
|
1586 |
|
| 1585 |
len = write(c->wfd, buf, dlen); |
1587 |
len = write(c->wfd, buf, dlen); |
| 1586 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
1588 |
if (len < 0 && |
|
|
1589 |
(errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)) |
| 1587 |
return 1; |
1590 |
return 1; |
| 1588 |
if (len <= 0) { |
1591 |
if (len <= 0) { |
| 1589 |
if (c->type != SSH_CHANNEL_OPEN) { |
1592 |
if (c->type != SSH_CHANNEL_OPEN) { |
|
Lines 1635-1641
channel_handle_efd(Channel *c, fd_set *r
Link Here
|
| 1635 |
buffer_len(&c->extended)); |
1638 |
buffer_len(&c->extended)); |
| 1636 |
debug2("channel %d: written %d to efd %d", |
1639 |
debug2("channel %d: written %d to efd %d", |
| 1637 |
c->self, len, c->efd); |
1640 |
c->self, len, c->efd); |
| 1638 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
1641 |
if (len < 0 && (errno == EINTR || errno == EAGAIN || |
|
|
1642 |
errno == EWOULDBLOCK)) |
| 1639 |
return 1; |
1643 |
return 1; |
| 1640 |
if (len <= 0) { |
1644 |
if (len <= 0) { |
| 1641 |
debug2("channel %d: closing write-efd %d", |
1645 |
debug2("channel %d: closing write-efd %d", |
|
Lines 1650-1657
channel_handle_efd(Channel *c, fd_set *r
Link Here
|
| 1650 |
len = read(c->efd, buf, sizeof(buf)); |
1654 |
len = read(c->efd, buf, sizeof(buf)); |
| 1651 |
debug2("channel %d: read %d from efd %d", |
1655 |
debug2("channel %d: read %d from efd %d", |
| 1652 |
c->self, len, c->efd); |
1656 |
c->self, len, c->efd); |
| 1653 |
if (len < 0 && (errno == EINTR || |
1657 |
if (len < 0 && (errno == EINTR || ((errno == EAGAIN || |
| 1654 |
(errno == EAGAIN && !c->detach_close))) |
1658 |
errno == EWOULDBLOCK) && !c->detach_close))) |
| 1655 |
return 1; |
1659 |
return 1; |
| 1656 |
if (len <= 0) { |
1660 |
if (len <= 0) { |
| 1657 |
debug2("channel %d: closing read-efd %d", |
1661 |
debug2("channel %d: closing read-efd %d", |
|
Lines 1675-1681
channel_handle_ctl(Channel *c, fd_set *r
Link Here
|
| 1675 |
/* Monitor control fd to detect if the slave client exits */ |
1679 |
/* Monitor control fd to detect if the slave client exits */ |
| 1676 |
if (c->ctl_fd != -1 && FD_ISSET(c->ctl_fd, readset)) { |
1680 |
if (c->ctl_fd != -1 && FD_ISSET(c->ctl_fd, readset)) { |
| 1677 |
len = read(c->ctl_fd, buf, sizeof(buf)); |
1681 |
len = read(c->ctl_fd, buf, sizeof(buf)); |
| 1678 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
1682 |
if (len < 0 && |
|
|
1683 |
(errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)) |
| 1679 |
return 1; |
1684 |
return 1; |
| 1680 |
if (len <= 0) { |
1685 |
if (len <= 0) { |
| 1681 |
debug2("channel %d: ctl read<=0", c->self); |
1686 |
debug2("channel %d: ctl read<=0", c->self); |