|
Lines 932-938
channel_pre_x11_open(Channel *c, fd_set
Link Here
|
| 932 |
} else if (ret == -1) { |
932 |
} else if (ret == -1) { |
| 933 |
logit("X11 connection rejected because of wrong authentication."); |
933 |
logit("X11 connection rejected because of wrong authentication."); |
| 934 |
debug2("X11 rejected %d i%d/o%d", c->self, c->istate, c->ostate); |
934 |
debug2("X11 rejected %d i%d/o%d", c->self, c->istate, c->ostate); |
| 935 |
chan_read_failed(c); |
935 |
chan_read_failed(c, 0); |
| 936 |
buffer_clear(&c->input); |
936 |
buffer_clear(&c->input); |
| 937 |
chan_ibuf_empty(c); |
937 |
chan_ibuf_empty(c); |
| 938 |
buffer_clear(&c->output); |
938 |
buffer_clear(&c->output); |
|
Lines 1446-1457
static int
Link Here
|
| 1446 |
channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset) |
1446 |
channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset) |
| 1447 |
{ |
1447 |
{ |
| 1448 |
char buf[CHAN_RBUF]; |
1448 |
char buf[CHAN_RBUF]; |
| 1449 |
int len; |
1449 |
int len, save_errno; |
| 1450 |
|
1450 |
|
| 1451 |
if (c->rfd != -1 && |
1451 |
if (c->rfd != -1 && |
| 1452 |
(c->detach_close || FD_ISSET(c->rfd, readset))) { |
1452 |
(c->detach_close || FD_ISSET(c->rfd, readset))) { |
| 1453 |
errno = 0; |
1453 |
errno = 0; |
| 1454 |
len = read(c->rfd, buf, sizeof(buf)); |
1454 |
len = read(c->rfd, buf, sizeof(buf)); |
|
|
1455 |
save_errno = errno; |
| 1455 |
if (len < 0 && (errno == EINTR || |
1456 |
if (len < 0 && (errno == EINTR || |
| 1456 |
(errno == EAGAIN && !(c->isatty && c->detach_close)))) |
1457 |
(errno == EAGAIN && !(c->isatty && c->detach_close)))) |
| 1457 |
return 1; |
1458 |
return 1; |
|
Lines 1472-1485
channel_handle_rfd(Channel *c, fd_set *r
Link Here
|
| 1472 |
c->type = SSH_CHANNEL_INPUT_DRAINING; |
1473 |
c->type = SSH_CHANNEL_INPUT_DRAINING; |
| 1473 |
debug2("channel %d: input draining.", c->self); |
1474 |
debug2("channel %d: input draining.", c->self); |
| 1474 |
} else { |
1475 |
} else { |
| 1475 |
chan_read_failed(c); |
1476 |
chan_read_failed(c, save_errno); |
| 1476 |
} |
1477 |
} |
| 1477 |
return -1; |
1478 |
return -1; |
| 1478 |
} |
1479 |
} |
| 1479 |
if (c->input_filter != NULL) { |
1480 |
if (c->input_filter != NULL) { |
| 1480 |
if (c->input_filter(c, buf, len) == -1) { |
1481 |
if (c->input_filter(c, buf, len) == -1) { |
| 1481 |
debug2("channel %d: filter stops", c->self); |
1482 |
debug2("channel %d: filter stops", c->self); |
| 1482 |
chan_read_failed(c); |
1483 |
chan_read_failed(c, 0); |
| 1483 |
} |
1484 |
} |
| 1484 |
} else if (c->datagram) { |
1485 |
} else if (c->datagram) { |
| 1485 |
buffer_put_string(&c->input, buf, len); |
1486 |
buffer_put_string(&c->input, buf, len); |
|
Lines 1643-1649
channel_handle_ctl(Channel *c, fd_set *r
Link Here
|
| 1643 |
chan_mark_dead(c); |
1644 |
chan_mark_dead(c); |
| 1644 |
return -1; |
1645 |
return -1; |
| 1645 |
} else { |
1646 |
} else { |
| 1646 |
chan_read_failed(c); |
1647 |
chan_read_failed(c, 0); |
| 1647 |
chan_write_failed(c); |
1648 |
chan_write_failed(c); |
| 1648 |
} |
1649 |
} |
| 1649 |
return -1; |
1650 |
return -1; |