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

Diff for /src/usr.bin/ssh/scp.c between version 1.112 and 1.113

version 1.112, 2003/11/21 11:57:03 version 1.113, 2003/11/23 23:21:21
Line 88 
Line 88 
 arglist args;  arglist args;
   
 /* Bandwidth limit */  /* Bandwidth limit */
 off_t limit = 0;  off_t limit_rate = 0;
   
 /* Name of current file being transferred. */  /* Name of current file being transferred. */
 char *curfile;  char *curfile;
Line 251 
Line 251 
                         speed = strtod(optarg, &endp);                          speed = strtod(optarg, &endp);
                         if (speed <= 0 || *endp != '\0')                          if (speed <= 0 || *endp != '\0')
                                 usage();                                  usage();
                         limit = speed * 1024;                          limit_rate = speed * 1024;
                         break;                          break;
                 case 'p':                  case 'p':
                         pflag = 1;                          pflag = 1;
Line 580 
Line 580 
                                         haderr = result >= 0 ? EIO : errno;                                          haderr = result >= 0 ? EIO : errno;
                                 statbytes += result;                                  statbytes += result;
                         }                          }
                         if (limit)                          if (limit_rate)
                                 bwlimit(amt);                                  bwlimit(amt);
                 }                  }
                 if (showprogress)                  if (showprogress)
Line 672 
Line 672 
                 return;                  return;
   
         lamt *= 8;          lamt *= 8;
         wait = (double)1000000L * lamt / limit;          wait = (double)1000000L * lamt / limit_rate;
   
         bwstart.tv_sec = wait / 1000000L;          bwstart.tv_sec = wait / 1000000L;
         bwstart.tv_usec = wait % 1000000L;          bwstart.tv_usec = wait % 1000000L;
Line 899 
Line 899 
                                 statbytes += j;                                  statbytes += j;
                         } while (amt > 0);                          } while (amt > 0);
   
                         if (limit)                          if (limit_rate)
                                 bwlimit(4096);                                  bwlimit(4096);
   
                         if (count == bp->cnt) {                          if (count == bp->cnt) {

Legend:
Removed from v.1.112  
changed lines
  Added in v.1.113