version 1.12, 1999/11/19 19:58:18 |
version 1.13, 1999/11/22 21:02:38 |
|
|
/* Read data from the socket. */ |
/* Read data from the socket. */ |
len = read(connection_in, buf, sizeof(buf)); |
len = read(connection_in, buf, sizeof(buf)); |
if (len == 0) |
if (len == 0) |
fatal("Connection closed by remote host."); |
fatal("Connection closed by %.200s", get_remote_ipaddr()); |
if (len < 0) |
if (len < 0) |
fatal("Read from socket failed: %.100s", strerror(errno)); |
fatal("Read from socket failed: %.100s", strerror(errno)); |
/* Append it to the buffer. */ |
/* Append it to the buffer. */ |
|
|
|
|
/* Handle disconnect message. */ |
/* Handle disconnect message. */ |
if ((unsigned char)buf[0] == SSH_MSG_DISCONNECT) |
if ((unsigned char)buf[0] == SSH_MSG_DISCONNECT) |
fatal("%.900s", packet_get_string(NULL)); |
fatal("Received disconnect: %.900s", packet_get_string(NULL)); |
|
|
/* Ignore ignore messages. */ |
/* Ignore ignore messages. */ |
if ((unsigned char)buf[0] == SSH_MSG_IGNORE) |
if ((unsigned char)buf[0] == SSH_MSG_IGNORE) |
|
|
packet_close(); |
packet_close(); |
|
|
/* Display the error locally and exit. */ |
/* Display the error locally and exit. */ |
fatal("Local: %.100s", buf); |
fatal("Disconnecting: %.100s", buf); |
} |
} |
|
|
/* Checks if there is any buffered output, and tries to write some of the |
/* Checks if there is any buffered output, and tries to write some of the |