version 1.133, 2001/09/17 20:52:47 |
version 1.134, 2001/09/17 21:04:01 |
|
|
channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset) |
channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset) |
{ |
{ |
struct termios tio; |
struct termios tio; |
|
u_char *data; |
|
u_int dlen; |
int len; |
int len; |
|
|
/* Send buffered output data to the socket. */ |
/* Send buffered output data to the socket. */ |
if (c->wfd != -1 && |
if (c->wfd != -1 && |
FD_ISSET(c->wfd, writeset) && |
FD_ISSET(c->wfd, writeset) && |
buffer_len(&c->output) > 0) { |
buffer_len(&c->output) > 0) { |
len = write(c->wfd, buffer_ptr(&c->output), |
data = buffer_ptr(&c->output); |
buffer_len(&c->output)); |
dlen = buffer_len(&c->output); |
|
len = write(c->wfd, data, dlen); |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
return 1; |
return 1; |
if (len <= 0) { |
if (len <= 0) { |
|
|
} |
} |
return -1; |
return -1; |
} |
} |
if (compat20 && c->isatty) { |
if (compat20 && c->isatty && dlen >= 1 && data[0] != '\r') { |
if (tcgetattr(c->wfd, &tio) == 0 && |
if (tcgetattr(c->wfd, &tio) == 0 && |
!(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) { |
!(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) { |
/* |
/* |