extern int bwlimit;
extern size_t bwlimit_writemax;
-extern int verbose;
extern int io_timeout;
extern int allowed_lull;
extern int am_server;
void increment_active_files(int ndx, int itemizing, enum logcode code)
{
/* TODO: tune these limits? */
- while (active_filecnt >= 10
- && (active_bytecnt >= 128*1024 || active_filecnt >= 50)) {
+ while (active_filecnt >= (active_bytecnt >= 128*1024 ? 10 : 50)) {
if (hlink_list.head)
check_for_finished_hlinks(itemizing, code);
read_msg_fd();
void read_sum_head(int f, struct sum_struct *sum)
{
sum->count = read_int(f);
+ if (sum->count < 0) {
+ rprintf(FERROR, "Invalid checksum count %ld [%s]\n",
+ (long)sum->count, who_am_i());
+ exit_cleanup(RERR_PROTOCOL);
+ }
sum->blength = read_int(f);
if (sum->blength < 0 || sum->blength > MAX_BLOCK_SIZE) {
rprintf(FERROR, "Invalid block length %ld [%s]\n",
#define ONE_SEC 1000000L /* # of microseconds in a second */
- if (!bwlimit)
+ if (!bwlimit_writemax)
return;
total_written += bytes_written;
continue;
n = len - total;
- if (bwlimit && n > bwlimit_writemax)
+ if (bwlimit_writemax && n > bwlimit_writemax)
n = bwlimit_writemax;
cnt = write(fd, buf + total, n);