From f4e1c1d4a42f0921d85c60853acc3c18e80222e8 Mon Sep 17 00:00:00 2001 From: Brian Tierney Date: Mon, 16 Nov 2009 02:50:24 +0000 Subject: [PATCH] fixes for -T mode --- src/iperf_server_api.c | 4 +++- src/tcp_info.c | 4 ++-- src/timer.c | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/iperf_server_api.c b/src/iperf_server_api.c index 9c05992..f25ec44 100644 --- a/src/iperf_server_api.c +++ b/src/iperf_server_api.c @@ -256,7 +256,9 @@ done: printf("Test Complete. \n\n"); /* reset cookie when client is finished */ - memset(test->streams->settings->cookie, '\0', COOKIE_SIZE); + /* XXX: which cookie to reset, and why is it stored to 2 places? */ + //memset(test->streams->settings->cookie, '\0', COOKIE_SIZE); + memset(test->default_settings->cookie, '\0', COOKIE_SIZE); return; } diff --git a/src/tcp_info.c b/src/tcp_info.c index 1fdce5c..38a5c99 100644 --- a/src/tcp_info.c +++ b/src/tcp_info.c @@ -42,8 +42,8 @@ get_tcpinfo(struct iperf_test *test, struct iperf_interval_results *rp) perror("getsockopt"); } /* for debugging */ - printf(" got TCP_INFO: %d, %d, %d, %d\n", rp->tcpInfo.tcpi_snd_cwnd, - rp->tcpInfo.tcpi_snd_ssthresh, rp->tcpInfo.tcpi_rcv_space, rp->tcpInfo.tcpi_rtt); + //printf(" got TCP_INFO: %d, %d, %d, %d\n", rp->tcpInfo.tcpi_snd_cwnd, + // rp->tcpInfo.tcpi_snd_ssthresh, rp->tcpInfo.tcpi_rcv_space, rp->tcpInfo.tcpi_rtt); return; #else return; diff --git a/src/timer.c b/src/timer.c index 325b249..1807ff9 100644 --- a/src/timer.c +++ b/src/timer.c @@ -77,6 +77,11 @@ new_timer(time_t sec, suseconds_t usec) { struct timer *tp; tp = (struct timer *) malloc(sizeof(struct timer)); + if (tp == NULL) + { + perror("malloc"); + return NULL; + } if (gettimeofday(&tp->begin, NULL) < 0) {