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

Diff for /src/usr.bin/ssh/sftp-server.c between version 1.72 and 1.73

version 1.72, 2007/04/18 01:12:43 version 1.73, 2007/05/17 07:55:29
Line 1193 
Line 1193 
         int in, out, max, ch, skipargs = 0, log_stderr = 0;          int in, out, max, ch, skipargs = 0, log_stderr = 0;
         ssize_t len, olen, set_size;          ssize_t len, olen, set_size;
         SyslogFacility log_facility = SYSLOG_FACILITY_AUTH;          SyslogFacility log_facility = SYSLOG_FACILITY_AUTH;
         char *cp;          char *cp, buf[4*4096];
   
         extern char *optarg;          extern char *optarg;
         extern char *__progname;          extern char *__progname;
Line 1271 
Line 1271 
                 memset(rset, 0, set_size);                  memset(rset, 0, set_size);
                 memset(wset, 0, set_size);                  memset(wset, 0, set_size);
   
                 FD_SET(in, rset);                  /*
                    * Ensure that we can read a full buffer and handle
                    * the worst-case length packet it can generate,
                    * otherwise apply backpressure by stopping reads.
                    */
                   if (buffer_check_alloc(&iqueue, sizeof(buf)) &&
                       buffer_check_alloc(&oqueue, SFTP_MAX_MSG_LENGTH))
                           FD_SET(in, rset);
   
                 olen = buffer_len(&oqueue);                  olen = buffer_len(&oqueue);
                 if (olen > 0)                  if (olen > 0)
                         FD_SET(out, wset);                          FD_SET(out, wset);
Line 1285 
Line 1293 
   
                 /* copy stdin to iqueue */                  /* copy stdin to iqueue */
                 if (FD_ISSET(in, rset)) {                  if (FD_ISSET(in, rset)) {
                         char buf[4*4096];  
                         len = read(in, buf, sizeof buf);                          len = read(in, buf, sizeof buf);
                         if (len == 0) {                          if (len == 0) {
                                 debug("read eof");                                  debug("read eof");
Line 1307 
Line 1314 
                                 buffer_consume(&oqueue, len);                                  buffer_consume(&oqueue, len);
                         }                          }
                 }                  }
                 /* process requests from client */  
                 process();                  /*
                    * Process requests from client if we can fit the results
                    * into the output buffer, otherwise stop processing input
                    * and let the output queue drain.
                    */
                   if (buffer_check_alloc(&oqueue, SFTP_MAX_MSG_LENGTH))
                           process();
         }          }
 }  }

Legend:
Removed from v.1.72  
changed lines
  Added in v.1.73