disabled timer for -n option
Этот коммит содержится в:
родитель
5212846ff4
Коммит
c5038eea0a
@ -63,7 +63,6 @@ int all_data_sent(struct iperf_test *test)
|
||||
|
||||
if(total_bytes >= (test->num_streams * test->default_settings->bytes))
|
||||
{
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@ -724,6 +723,7 @@ void iperf_defaults(struct iperf_test *testp)
|
||||
testp->default_settings->rate = RATE;
|
||||
testp->default_settings->state = TEST_START;
|
||||
testp->default_settings->mss = 0;
|
||||
testp->default_settings->bytes = 0;
|
||||
|
||||
for(i=0; i<37; i++)
|
||||
testp->default_settings->cookie[i] = '\0';
|
||||
@ -1533,9 +1533,13 @@ void iperf_run_client(struct iperf_test *test)
|
||||
sp->send_timer = new_timer(0, dtargus);
|
||||
sp= sp->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
timer = new_timer(test->duration, 0);
|
||||
// if -n specified, set zero timer
|
||||
if(test->default_settings->bytes == 0)
|
||||
timer = new_timer(test->duration, 0);
|
||||
else
|
||||
timer = new_timer(0,0);
|
||||
|
||||
if(test->stats_interval != 0)
|
||||
stats_interval = new_timer(test->stats_interval, 0);
|
||||
|
@ -31,6 +31,10 @@ timeval_diff(struct timeval *tv0, struct timeval *tv1)
|
||||
int
|
||||
timer_expired(struct timer *tp)
|
||||
{
|
||||
// for timer with zero time
|
||||
if (tp->end.tv_sec == tp->begin.tv_sec && tp->end.tv_usec == tp->begin.tv_usec)
|
||||
return 0;
|
||||
|
||||
struct timeval now;
|
||||
int64_t end = 0, current= 0, diff= 0;
|
||||
if(gettimeofday(&now, NULL) < 0) {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user