version 1.90, 2001/02/08 21:58:28 |
version 1.91, 2001/02/15 23:19:59 |
|
|
c->efd = efd; |
c->efd = efd; |
c->extended_usage = extusage; |
c->extended_usage = extusage; |
|
|
|
/* XXX ugly hack: nonblock is only set by the server */ |
|
if (nonblock && isatty(c->rfd)) { |
|
debug("channel: %d: rfd %d isatty", c->self, c->rfd); |
|
c->isatty = 1; |
|
if (!isatty(c->wfd)) { |
|
error("channel: %d: wfd %d is not a tty?", |
|
c->self, c->wfd); |
|
} |
|
} else { |
|
c->isatty = 0; |
|
} |
|
|
/* enable nonblocking mode */ |
/* enable nonblocking mode */ |
if (nonblock) { |
if (nonblock) { |
if (rfd != -1) |
if (rfd != -1) |
|
|
chan_write_failed(c); |
chan_write_failed(c); |
} |
} |
return -1; |
return -1; |
|
} |
|
if (compat20 && c->isatty) { |
|
struct termios tio; |
|
if (tcgetattr(c->wfd, &tio) == 0 && |
|
!(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) { |
|
/* |
|
* Simulate echo to reduce the impact of |
|
* traffic analysis. |
|
*/ |
|
packet_start(SSH2_MSG_IGNORE); |
|
memset(buffer_ptr(&c->output), 0, len); |
|
packet_put_string(buffer_ptr(&c->output), len); |
|
packet_send(); |
|
debug("channel: %d simulate echo (%d)", c->self, len); |
|
} |
} |
} |
buffer_consume(&c->output, len); |
buffer_consume(&c->output, len); |
if (compat20 && len > 0) { |
if (compat20 && len > 0) { |