version 1.6, 1999/09/30 08:34:24 |
version 1.7, 1999/10/16 20:57:52 |
|
|
if (errno == EINTR) |
if (errno == EINTR) |
return; |
return; |
/* Note: we might still have data in the buffers. */ |
/* Note: we might still have data in the buffers. */ |
sprintf(buf, "select: %.100s\r\n", strerror(errno)); |
snprintf(buf, sizeof buf, "select: %s\r\n", strerror(errno)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
stderr_bytes += strlen(buf); |
stderr_bytes += strlen(buf); |
quit_pending = 1; |
quit_pending = 1; |
|
|
if (len == 0) |
if (len == 0) |
{ |
{ |
/* Received EOF. The remote host has closed the connection. */ |
/* Received EOF. The remote host has closed the connection. */ |
sprintf(buf, "Connection to %.300s closed by remote host.\r\n", |
snprintf(buf, sizeof buf, "Connection to %.300s closed by remote host.\r\n", |
host); |
host); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
stderr_bytes += strlen(buf); |
stderr_bytes += strlen(buf); |
|
|
{ |
{ |
/* An error has encountered. Perhaps there is a network |
/* An error has encountered. Perhaps there is a network |
problem. */ |
problem. */ |
sprintf(buf, "Read from remote host %.300s: %.100s\r\n", |
snprintf(buf, sizeof buf, "Read from remote host %.300s: %.100s\r\n", |
host, strerror(errno)); |
host, strerror(errno)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
stderr_bytes += strlen(buf); |
stderr_bytes += strlen(buf); |
|
|
an error condition. */ |
an error condition. */ |
if (len < 0) |
if (len < 0) |
{ |
{ |
sprintf(buf, "read: %.100s\r\n", strerror(errno)); |
snprintf(buf, sizeof buf, "read: %.100s\r\n", strerror(errno)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
stderr_bytes += strlen(buf); |
stderr_bytes += strlen(buf); |
} |
} |
|
|
{ |
{ |
case '.': |
case '.': |
/* Terminate the connection. */ |
/* Terminate the connection. */ |
sprintf(buf, "%c.\r\n", escape_char); |
snprintf(buf, sizeof buf, "%c.\r\n", escape_char); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
stderr_bytes += strlen(buf); |
stderr_bytes += strlen(buf); |
quit_pending = 1; |
quit_pending = 1; |
|
|
case 'Z' - 64: |
case 'Z' - 64: |
/* Suspend the program. */ |
/* Suspend the program. */ |
/* Print a message to that effect to the user. */ |
/* Print a message to that effect to the user. */ |
sprintf(buf, "%c^Z\r\n", escape_char); |
snprintf(buf, sizeof buf, "%c^Z\r\n", escape_char); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
stderr_bytes += strlen(buf); |
stderr_bytes += strlen(buf); |
|
|
|
|
continue; |
continue; |
|
|
case '?': |
case '?': |
sprintf(buf, "%c?\r\n\ |
snprintf(buf, sizeof buf, "%c?\r\n\ |
Supported escape sequences:\r\n\ |
Supported escape sequences:\r\n\ |
~. - terminate connection\r\n\ |
~. - terminate connection\r\n\ |
~^Z - suspend ssh\r\n\ |
~^Z - suspend ssh\r\n\ |
|
|
continue; |
continue; |
|
|
case '#': |
case '#': |
sprintf(buf, "%c#\r\n", escape_char); |
snprintf(buf, sizeof buf, "%c#\r\n", escape_char); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
s = channel_open_message(); |
s = channel_open_message(); |
buffer_append(&stderr_buffer, s, strlen(s)); |
buffer_append(&stderr_buffer, s, strlen(s)); |
|
|
{ |
{ |
/* An error or EOF was encountered. Put an error message |
/* An error or EOF was encountered. Put an error message |
to stderr buffer. */ |
to stderr buffer. */ |
sprintf(buf, "write stdout: %.50s\r\n", strerror(errno)); |
snprintf(buf, sizeof buf, "write stdout: %.50s\r\n", strerror(errno)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
stderr_bytes += strlen(buf); |
stderr_bytes += strlen(buf); |
quit_pending = 1; |
quit_pending = 1; |
|
|
the connection has been closed. */ |
the connection has been closed. */ |
if (have_pty && !quiet_flag) |
if (have_pty && !quiet_flag) |
{ |
{ |
sprintf(buf, "Connection to %.64s closed.\r\n", host); |
snprintf(buf, sizeof buf, "Connection to %.64s closed.\r\n", host); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
buffer_append(&stderr_buffer, buf, strlen(buf)); |
stderr_bytes += strlen(buf); |
stderr_bytes += strlen(buf); |
} |
} |