diff options
author | Jef Poskanzer <jef@mail.acme.com> | 2013-10-24 14:08:04 -0700 |
---|---|---|
committer | Jef Poskanzer <jef@mail.acme.com> | 2013-10-24 14:08:04 -0700 |
commit | a953f5aa2c135c37b2085d477e0c1a5ce3242473 (patch) | |
tree | 534c6f5ac33ce4bcbf0350b10c14961960efca83 /src/iperf_server_api.c | |
parent | ea5d93b2415a796b53bb1586bf71e1034ec39b29 (diff) | |
download | iperf3-a953f5aa2c135c37b2085d477e0c1a5ce3242473.tar.gz |
Re-do of how --omit works.
Diffstat (limited to 'src/iperf_server_api.c')
-rw-r--r-- | src/iperf_server_api.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/iperf_server_api.c b/src/iperf_server_api.c index be20799..5ec6600 100644 --- a/src/iperf_server_api.c +++ b/src/iperf_server_api.c @@ -289,7 +289,7 @@ server_omit_timer_proc(TimerClientData client_data, struct timeval *nowP) test->omit_timer = NULL; test->omitting = 0; iperf_reset_stats(test); - if (test->verbose && !test->json_output) + if (test->verbose && !test->json_output && test->reporter_interval == 0) printf("Finished omit period, starting real test\n"); } @@ -299,17 +299,23 @@ create_server_omit_timer(struct iperf_test * test) struct timeval now; TimerClientData cd; - if (gettimeofday(&now, NULL) < 0) { - i_errno = IEINITTEST; - return -1; - } - test->omitting = 1; - cd.p = test; - test->omit_timer = tmr_create(&now, server_omit_timer_proc, cd, test->omit * SEC_TO_US, 0); - if (test->omit_timer == NULL) { - i_errno = IEINITTEST; - return -1; + if (test->omit == 0) { + test->omit_timer = NULL; + test->omitting = 0; + } else { + if (gettimeofday(&now, NULL) < 0) { + i_errno = IEINITTEST; + return -1; + } + test->omitting = 1; + cd.p = test; + test->omit_timer = tmr_create(&now, server_omit_timer_proc, cd, test->omit * SEC_TO_US, 0); + if (test->omit_timer == NULL) { + i_errno = IEINITTEST; + return -1; + } } + return 0; } |