a bit more cleanup

This commit is contained in:
Brian Tierney 2009-11-15 17:06:16 +00:00
parent 1882b9cb65
commit 5ed85b8fa1
3 changed files with 9 additions and 13 deletions

View File

@ -3,14 +3,12 @@ Current list of things to fix/add to iperf 3.0
- test -T option on server
- separate iperf_api.c into iperf_client.c and iperf_utils.c
- verify placment of all timing calls and total_bytes_sent computations
- look for 'XXX' in code and address
- much better/standard error handling throughout
- better packaging/makefile, README, LICENCE, etc files
- currently several places in the code where a linked list must be scanned to find the end.
It would be better to store a pointer to the last element.
- reedd -Z option (linux tcp congestion control algoritm)
- readd -Z option (linux tcp congestion control algoritm)
- readd flog to set IP_TOS (-S)
- add verbose and debug options
- finish/fix receive_result_from_server()
- should this be called for TCP too, or only UDP (currently its both,
but I think it should be UDP only, or maybe a command line option for TCP
@ -20,7 +18,6 @@ Current list of things to fix/add to iperf 3.0
add TCP control socket?
use clock_nanosleep() for more accurate timing in Linux?
(http://www.kernel.org/doc/man-pages/online/pages/man2/clock_nanosleep.2.html)
- add verbose and debug options
- add human readable vs machine readable output mode
(my idea on this is that "human readable" = compatable with old iperf,
and that "machine readable is all name=value pairs -blt )

View File

@ -50,7 +50,7 @@ struct iperf_settings
iperf_size_t bytes; /* -n option */
char unit_format; /* -f */
/* XXX: not sure about this design: everything else is this struct is static state,
but the last 2 are dymanic state. Should they be in iperf_stream instead? */
but the last 2 are dynamic state. Should they be in iperf_stream instead? */
int state; /* This is state of a stream/test */
char cookie[COOKIE_SIZE];
};
@ -60,7 +60,7 @@ struct iperf_stream
/* configurable members */
int local_port;
int remote_port;
/* XXX: is this just a pointer to the same struct in iperf_test? if not,
/* XXX: is settings just a pointer to the same struct in iperf_test? if not,
should it be? */
struct iperf_settings *settings; /* pointer to structure settings */

View File

@ -446,12 +446,6 @@ iperf_stats_callback(struct iperf_test * test)
else
temp.bytes_transferred = rp->bytes_received;
if (temp.bytes_transferred == 0)
{
printf("iperf_stats_callback: should not be here, no data read \n");
exit(-1); /* XXX: clean up later once understand why this happends */
}
ip = sp->result->interval_results;
/* result->end_time contains timestamp of previous interval */
if ( ip != NULL ) /* not the 1st interval */
@ -573,12 +567,14 @@ iperf_reporter_callback(struct iperf_test * test)
sprintf(message, report_bw_format, sp->socket, start_time, end_time, ubuf, nbuf);
//printf("iperf_reporter_callback 2: message = %s \n", message);
safe_strcat(message_final, message);
#if defined(linux) || defined(__FreeBSD__)
if (test->tcp_info)
{
printf("Final TCP_INFO results: \n");
build_tcpinfo_message(ip, message);
safe_strcat(message_final, message);
}
#endif
} else
{ /* UDP mode */
sprintf(message, report_bw_jitter_loss_format, sp->socket, start_time,
@ -659,11 +655,13 @@ print_interval_results(struct iperf_test * test, struct iperf_stream * sp, char
//printf("print_interval_results 1: message = %s \n", message);
safe_strcat(message_final, message);
#if defined(linux) || defined(__FreeBSD__)
if (test->tcp_info)
{
build_tcpinfo_message(ir, message);
safe_strcat(message_final, message);
}
#endif
//printf("reporter_callback: built interval string: %s \n", message_final);
free(message);
return message_final;
@ -680,6 +678,7 @@ safe_strcat(char *s1, char *s2)
{
printf("Error: results string too long \n");
exit(-1); /* XXX: should return an error instead! */
/* but code that calls this needs to check for error first */
//return -1;
}
}