|
Lines 1302-1327
ssh_packet_read_seqnr(struct ssh *ssh, u
Link Here
|
| 1302 |
break; |
1302 |
break; |
| 1303 |
} |
1303 |
} |
| 1304 |
} |
1304 |
} |
| 1305 |
if (r == 0) { |
1305 |
if (r == 0) |
| 1306 |
logit("Connection to %.200s timed out while " |
1306 |
return SSH_ERR_CONN_TIMEOUT; |
| 1307 |
"waiting to read", ssh_remote_ipaddr(ssh)); |
|
|
| 1308 |
cleanup_exit(255); |
| 1309 |
} |
| 1310 |
/* Read data from the socket. */ |
1307 |
/* Read data from the socket. */ |
| 1311 |
do { |
1308 |
do { |
| 1312 |
cont = 0; |
1309 |
cont = 0; |
| 1313 |
len = roaming_read(state->connection_in, buf, |
1310 |
len = roaming_read(state->connection_in, buf, |
| 1314 |
sizeof(buf), &cont); |
1311 |
sizeof(buf), &cont); |
| 1315 |
} while (len == 0 && cont); |
1312 |
} while (len == 0 && cont); |
| 1316 |
if (len == 0) { |
1313 |
if (len == 0) |
| 1317 |
logit("Connection closed by %.200s", |
1314 |
return SSH_ERR_CONN_CLOSED; |
| 1318 |
ssh_remote_ipaddr(ssh)); |
|
|
| 1319 |
cleanup_exit(255); |
| 1320 |
} |
| 1321 |
if (len < 0) |
1315 |
if (len < 0) |
| 1322 |
fatal("Read from socket failed: %.100s", strerror(errno)); |
1316 |
return SSH_ERR_SYSTEM_ERROR; |
|
|
1317 |
|
| 1323 |
/* Append it to the buffer. */ |
1318 |
/* Append it to the buffer. */ |
| 1324 |
ssh_packet_process_incoming(ssh, buf, len); |
1319 |
if ((r = ssh_packet_process_incoming(ssh, buf, len)) != 0) |
|
|
1320 |
return r; |
| 1325 |
} |
1321 |
} |
| 1326 |
free(setp); |
1322 |
free(setp); |
| 1327 |
return r; |
1323 |
return r; |
|
Lines 1775-1781
ssh_packet_read_poll_seqnr(struct ssh *s
Link Here
|
| 1775 |
* together with packet_read_poll. |
1771 |
* together with packet_read_poll. |
| 1776 |
*/ |
1772 |
*/ |
| 1777 |
|
1773 |
|
| 1778 |
void |
1774 |
int |
| 1779 |
ssh_packet_process_incoming(struct ssh *ssh, const char *buf, u_int len) |
1775 |
ssh_packet_process_incoming(struct ssh *ssh, const char *buf, u_int len) |
| 1780 |
{ |
1776 |
{ |
| 1781 |
struct session_state *state = ssh->state; |
1777 |
struct session_state *state = ssh->state; |
|
Lines 1785-1798
ssh_packet_process_incoming(struct ssh *
Link Here
|
| 1785 |
state->keep_alive_timeouts = 0; /* ?? */ |
1781 |
state->keep_alive_timeouts = 0; /* ?? */ |
| 1786 |
if (len >= state->packet_discard) { |
1782 |
if (len >= state->packet_discard) { |
| 1787 |
if ((r = ssh_packet_stop_discard(ssh)) != 0) |
1783 |
if ((r = ssh_packet_stop_discard(ssh)) != 0) |
| 1788 |
fatal("%s: %s", __func__, ssh_err(r)); |
1784 |
return r; |
| 1789 |
cleanup_exit(255); |
|
|
| 1790 |
} |
1785 |
} |
| 1791 |
state->packet_discard -= len; |
1786 |
state->packet_discard -= len; |
| 1792 |
return; |
1787 |
return 0; |
| 1793 |
} |
1788 |
} |
| 1794 |
if ((r = sshbuf_put(ssh->state->input, buf, len)) != 0) |
1789 |
if ((r = sshbuf_put(ssh->state->input, buf, len)) != 0) |
| 1795 |
fatal("%s: %s", __func__, ssh_err(r)); |
1790 |
return r; |
|
|
1791 |
|
| 1792 |
return 0; |
| 1796 |
} |
1793 |
} |
| 1797 |
|
1794 |
|
| 1798 |
int |
1795 |
int |