| 209 | } |
| 210 | |
| 211 | static int |
| 212 | create_client_timers(struct iperf_test * test) |
| 213 | { |
| 214 | struct iperf_time now; |
| 215 | TimerClientData cd; |
| 216 | if (NULL == test) |
| 217 | { |
| 218 | iperf_err(NULL, "No test\n"); |
| 219 | i_errno = IEINITTEST; |
| 220 | return -1; |
| 221 | } |
| 222 | |
| 223 | if (iperf_time_now(&now) < 0) { |
| 224 | i_errno = IEINITTEST; |
| 225 | return -1; |
| 226 | } |
| 227 | cd.p = test; |
| 228 | test->timer = test->stats_timer = test->reporter_timer = NULL; |
| 229 | if (test->duration != 0) { |
| 230 | test->done = 0; |
| 231 | test->timer = tmr_create(&now, test_timer_proc, cd, ( test->duration + test->omit ) * SEC_TO_US, 0); |
| 232 | if (test->timer == NULL) { |
| 233 | i_errno = IEINITTEST; |
| 234 | return -1; |
| 235 | } |
| 236 | } |
| 237 | if (test->stats_interval != 0) { |
| 238 | test->stats_timer = tmr_create(&now, client_stats_timer_proc, cd, test->stats_interval * SEC_TO_US, 1); |
| 239 | if (test->stats_timer == NULL) { |
| 240 | i_errno = IEINITTEST; |
| 241 | return -1; |
| 242 | } |
| 243 | } |
| 244 | if (test->reporter_interval != 0) { |
| 245 | test->reporter_timer = tmr_create(&now, client_reporter_timer_proc, cd, test->reporter_interval * SEC_TO_US, 1); |
| 246 | if (test->reporter_timer == NULL) { |
| 247 | i_errno = IEINITTEST; |
| 248 | return -1; |
| 249 | } |
| 250 | } |
| 251 | return 0; |
| 252 | } |
| 253 | |
| 254 | static void |
| 255 | client_omit_timer_proc(TimerClientData client_data, struct iperf_time *nowP) |
no test coverage detected
searching dependent graphs…