From 1882b9cb65b42f0771e50b891142059061536d70 Mon Sep 17 00:00:00 2001 From: Brian Tierney Date: Sun, 15 Nov 2009 04:47:19 +0000 Subject: [PATCH] turned off some debug code, and fixed a bug in interval times --- src/iperf_api.c | 6 +++--- src/iperf_server_api.c | 6 +++--- src/iperf_tcp.c | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/iperf_api.c b/src/iperf_api.c index e569dd2..4b0bf72 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -515,7 +515,7 @@ iperf_reporter_callback(struct iperf_test * test) sp = test->streams; /* reset back to 1st stream */ if (test->num_streams > 1) { - ip = test->streams->result->interval_results; /* use 1st stream for timing info */ + ip = test->streams->result->last_interval_results; /* use 1st stream for timing info */ unit_snprintf(ubuf, UNIT_LEN, (double) (bytes), 'A'); start_time = timeval_diff(&sp->result->start_time,&ip->interval_start_time); @@ -637,7 +637,7 @@ print_interval_results(struct iperf_test * test, struct iperf_stream * sp, char char *message = (char *) malloc(MAX_RESULT_STRING); //printf("in print_interval_results for stream %d \n", sp->socket); - ir = sp->result->interval_results; + ir = sp->result->last_interval_results; /* get last entry in linked list */ if (ir == NULL) { printf("print_interval_results Error: interval_results = NULL \n"); @@ -941,7 +941,7 @@ iperf_run_client(struct iperf_test * test) //printf("Done getting/printing results. \n"); - printf("send TEST_END to server \n"); + //printf("send TEST_END to server \n"); sp->settings->state = TEST_END; sp->snd(sp); /* send message to server */ diff --git a/src/iperf_server_api.c b/src/iperf_server_api.c index 7adc8c2..9c05992 100644 --- a/src/iperf_server_api.c +++ b/src/iperf_server_api.c @@ -182,7 +182,7 @@ iperf_run_server(struct iperf_test * test) test->accept(test); test->default_settings->state = TEST_RUNNING; FD_CLR(test->listener_sock_tcp, &test->temp_set); - printf("iperf_run_server: accepted TCP connection \n"); + //printf("iperf_run_server: accepted TCP connection \n"); test->num_streams++; } } else @@ -310,14 +310,14 @@ handle_message(struct iperf_test * test, int message, struct iperf_stream * sp) } if (message == ALL_STREAMS_END) { - printf("client sent ALL_STREAMS_END message, printing results \n"); + printf("Client done sending data. Printing final results. \n"); /* print server results */ results_string = test->reporter_callback(test); puts(results_string); /* send to stdio */ } if (message == TEST_END) { - printf("client sent TEST_END message, shuting down sockets.. \n"); + //printf("client sent TEST_END message, shuting down sockets.. \n"); /* FREE ALL STREAMS */ tp1 = test->streams; do diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c index 1ec0aba..2532d9b 100644 --- a/src/iperf_tcp.c +++ b/src/iperf_tcp.c @@ -75,9 +75,12 @@ iperf_tcp_recv(struct iperf_stream * sp) return -1; } sp->settings->state = message; + +#ifdef DEBUG if (message != STREAM_RUNNING) /* tell me about non STREAM_RUNNING messages * for debugging */ printf("iperf_tcp_recv: got message type %d \n", message); +#endif switch (message) {