| 3527 | |
| 3528 | |
| 3529 | void |
| 3530 | iperf_reset_test(struct iperf_test *test) |
| 3531 | { |
| 3532 | struct iperf_stream *sp; |
| 3533 | int i; |
| 3534 | |
| 3535 | iperf_close_logfile(test); |
| 3536 | |
| 3537 | /* Free streams */ |
| 3538 | while (!SLIST_EMPTY(&test->streams)) { |
| 3539 | sp = SLIST_FIRST(&test->streams); |
| 3540 | SLIST_REMOVE_HEAD(&test->streams, streams); |
| 3541 | iperf_free_stream(sp); |
| 3542 | } |
| 3543 | if (test->omit_timer != NULL) { |
| 3544 | tmr_cancel(test->omit_timer); |
| 3545 | test->omit_timer = NULL; |
| 3546 | } |
| 3547 | if (test->timer != NULL) { |
| 3548 | tmr_cancel(test->timer); |
| 3549 | test->timer = NULL; |
| 3550 | } |
| 3551 | if (test->stats_timer != NULL) { |
| 3552 | tmr_cancel(test->stats_timer); |
| 3553 | test->stats_timer = NULL; |
| 3554 | } |
| 3555 | if (test->reporter_timer != NULL) { |
| 3556 | tmr_cancel(test->reporter_timer); |
| 3557 | test->reporter_timer = NULL; |
| 3558 | } |
| 3559 | test->done = 0; |
| 3560 | |
| 3561 | SLIST_INIT(&test->streams); |
| 3562 | |
| 3563 | if (test->congestion) |
| 3564 | free(test->congestion); |
| 3565 | test->congestion = NULL; |
| 3566 | if (test->remote_congestion_used) |
| 3567 | free(test->remote_congestion_used); |
| 3568 | test->remote_congestion_used = NULL; |
| 3569 | test->role = 's'; |
| 3570 | test->mode = RECEIVER; |
| 3571 | test->sender_has_retransmits = 0; |
| 3572 | set_protocol(test, Ptcp); |
| 3573 | test->omit = OMIT; |
| 3574 | test->duration = DURATION; |
| 3575 | test->server_affinity = -1; |
| 3576 | #if defined(HAVE_CPUSET_SETAFFINITY) |
| 3577 | CPU_ZERO(&test->cpumask); |
| 3578 | #endif /* HAVE_CPUSET_SETAFFINITY */ |
| 3579 | test->state = 0; |
| 3580 | |
| 3581 | test->ctrl_sck = -1; |
| 3582 | test->listener = -1; |
| 3583 | test->prot_listener = -1; |
| 3584 | |
| 3585 | test->bytes_sent = 0; |
| 3586 | test->blocks_sent = 0; |
no test coverage detected
searching dependent graphs…