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

Diff for /src/usr.bin/ssh/ssh-agent.c between version 1.232 and 1.233

version 1.232, 2018/11/09 02:57:58 version 1.233, 2019/01/22 22:58:50
Line 81 
Line 81 
   
 /* Maximum accepted message length */  /* Maximum accepted message length */
 #define AGENT_MAX_LEN   (256*1024)  #define AGENT_MAX_LEN   (256*1024)
   /* Maximum bytes to read from client socket */
   #define AGENT_RBUF_LEN  (4096)
   
 typedef enum {  typedef enum {
         AUTH_UNUSED,          AUTH_UNUSED,
Line 824 
Line 826 
 static int  static int
 handle_conn_read(u_int socknum)  handle_conn_read(u_int socknum)
 {  {
         char buf[1024];          char buf[AGENT_RBUF_LEN];
         ssize_t len;          ssize_t len;
         int r;          int r;
   
Line 931 
Line 933 
         struct pollfd *pfd = *pfdp;          struct pollfd *pfd = *pfdp;
         size_t i, j, npfd = 0;          size_t i, j, npfd = 0;
         time_t deadline;          time_t deadline;
           int r;
   
         /* Count active sockets */          /* Count active sockets */
         for (i = 0; i < sockets_alloc; i++) {          for (i = 0; i < sockets_alloc; i++) {
Line 968 
Line 971 
                 case AUTH_CONNECTION:                  case AUTH_CONNECTION:
                         pfd[j].fd = sockets[i].fd;                          pfd[j].fd = sockets[i].fd;
                         pfd[j].revents = 0;                          pfd[j].revents = 0;
                         /* XXX backoff when input buffer full */                          /*
                         pfd[j].events = POLLIN;                           * Only prepare to read if we can handle a full-size
                            * input read buffer and enqueue a max size reply..
                            */
                           if ((r = sshbuf_check_reserve(sockets[i].input,
                               AGENT_RBUF_LEN)) == 0 &&
                               (r = sshbuf_check_reserve(sockets[i].output,
                                AGENT_MAX_LEN)) == 0)
                                   pfd[j].events = POLLIN;
                           else if (r != SSH_ERR_NO_BUFFER_SPACE) {
                                   fatal("%s: buffer error: %s",
                                       __func__, ssh_err(r));
                           }
                         if (sshbuf_len(sockets[i].output) > 0)                          if (sshbuf_len(sockets[i].output) > 0)
                                 pfd[j].events |= POLLOUT;                                  pfd[j].events |= POLLOUT;
                         j++;                          j++;

Legend:
Removed from v.1.232  
changed lines
  Added in v.1.233