if iperf_connect fails, it crashes in test->reporter_callback functions.
This patch fixes this problem.
And current iperf_client_end() try to send state after close ctrl socket.
This problem is also fixed by this patch.
Change-Id: I965e3e2b40f1e7e19d913342888c6fc43fa12675
Signed-off-by: EunBong Song <eunb.song@samsung.com>
{
struct iperf_stream *sp;
+ /* show final summary */
+ test->reporter_callback(test);
+
+ iperf_set_send_state(test, IPERF_DONE);
+
/* Close all stream sockets */
SLIST_FOREACH(sp, &test->streams, streams) {
close(sp->socket);
close(test->ctrl_sck);
}
- /* show final summary */
- test->reporter_callback(test);
-
- if (iperf_set_send_state(test, IPERF_DONE) != 0) {
- return -1;
- }
-
return 0;
}
/* Start the client and connect to the server */
if (iperf_connect(test) < 0) {
- return -1;
+ iperf_free_test(test);
+ exit(1);
}
/* Begin calculating CPU utilization */