version 1.162, 2005/03/10 22:01:06 |
version 1.163, 2005/05/24 17:32:44 |
|
|
int connection_out = packet_get_connection_out(); |
int connection_out = packet_get_connection_out(); |
int minor1 = PROTOCOL_MINOR_1; |
int minor1 = PROTOCOL_MINOR_1; |
|
|
/* Read other side\'s version identification. */ |
/* Read other side's version identification. */ |
for (;;) { |
for (;;) { |
for (i = 0; i < sizeof(buf) - 1; i++) { |
for (i = 0; i < sizeof(buf) - 1; i++) { |
int len = atomicio(read, connection_in, &buf[i], 1); |
size_t len = atomicio(read, connection_in, &buf[i], 1); |
if (len < 0) |
|
fatal("ssh_exchange_identification: read: %.100s", strerror(errno)); |
if (len != 1 && errno == EPIPE) |
if (len != 1) |
|
fatal("ssh_exchange_identification: Connection closed by remote host"); |
fatal("ssh_exchange_identification: Connection closed by remote host"); |
|
else if (len != 1) |
|
fatal("ssh_exchange_identification: read: %.100s", strerror(errno)); |
if (buf[i] == '\r') { |
if (buf[i] == '\r') { |
buf[i] = '\n'; |
buf[i] = '\n'; |
buf[i + 1] = 0; |
buf[i + 1] = 0; |