[BACK]Return to packet.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/packet.c between version 1.203 and 1.204

version 1.203, 2015/01/20 23:14:00 version 1.204, 2015/01/28 21:15:47
Line 1302 
Line 1302 
                                 break;                                  break;
                         }                          }
                 }                  }
                 if (r == 0) {                  if (r == 0)
                         logit("Connection to %.200s timed out while "                          return SSH_ERR_CONN_TIMEOUT;
                             "waiting to read", ssh_remote_ipaddr(ssh));  
                         cleanup_exit(255);  
                 }  
                 /* Read data from the socket. */                  /* Read data from the socket. */
                 do {                  do {
                         cont = 0;                          cont = 0;
                         len = roaming_read(state->connection_in, buf,                          len = roaming_read(state->connection_in, buf,
                             sizeof(buf), &cont);                              sizeof(buf), &cont);
                 } while (len == 0 && cont);                  } while (len == 0 && cont);
                 if (len == 0) {                  if (len == 0)
                         logit("Connection closed by %.200s",                          return SSH_ERR_CONN_CLOSED;
                             ssh_remote_ipaddr(ssh));  
                         cleanup_exit(255);  
                 }  
                 if (len < 0)                  if (len < 0)
                         fatal("Read from socket failed: %.100s", strerror(errno));                          return SSH_ERR_SYSTEM_ERROR;
   
                 /* Append it to the buffer. */                  /* Append it to the buffer. */
                 ssh_packet_process_incoming(ssh, buf, len);                  if ((r = ssh_packet_process_incoming(ssh, buf, len)) != 0)
                           return r;
         }          }
         free(setp);          free(setp);
         return r;          return r;
Line 1775 
Line 1771 
  * together with packet_read_poll.   * together with packet_read_poll.
  */   */
   
 void  int
 ssh_packet_process_incoming(struct ssh *ssh, const char *buf, u_int len)  ssh_packet_process_incoming(struct ssh *ssh, const char *buf, u_int len)
 {  {
         struct session_state *state = ssh->state;          struct session_state *state = ssh->state;
Line 1785 
Line 1781 
                 state->keep_alive_timeouts = 0; /* ?? */                  state->keep_alive_timeouts = 0; /* ?? */
                 if (len >= state->packet_discard) {                  if (len >= state->packet_discard) {
                         if ((r = ssh_packet_stop_discard(ssh)) != 0)                          if ((r = ssh_packet_stop_discard(ssh)) != 0)
                                 fatal("%s: %s", __func__, ssh_err(r));                                  return r;
                         cleanup_exit(255);  
                 }                  }
                 state->packet_discard -= len;                  state->packet_discard -= len;
                 return;                  return 0;
         }          }
         if ((r = sshbuf_put(ssh->state->input, buf, len)) != 0)          if ((r = sshbuf_put(ssh->state->input, buf, len)) != 0)
                 fatal("%s: %s", __func__, ssh_err(r));                  return r;
   
           return 0;
 }  }
   
 int  int

Legend:
Removed from v.1.203  
changed lines
  Added in v.1.204