version 1.112, 2003/11/21 11:57:03 |
version 1.113, 2003/11/23 23:21:21 |
|
|
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; |
|
|
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; |
|
|
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) |
|
|
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; |
|
|
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) { |