print report headers only once

use correct report header for UDP tests
This commit is contained in:
Jon Dugan 2008-04-09 00:08:11 +00:00
parent 1f11f10308
commit 2c094e1e14
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2008-04-08 Jon Dugan <jdugan@x1024.net>
* print report headers only once
* use appropriate report header for UDP tests
2008-04-07 Jon Dugan <jdugan@x1024.net>
* Add man page to autoconf goo

View File

@ -67,6 +67,7 @@ extern "C" {
* Prints transfer reports in default style
*/
void reporter_printstats( Transfer_Info *stats ) {
static char header_printed = 0;
byte_snprintf( buffer, sizeof(buffer)/2, (double) stats->TotalLen,
toupper( stats->mFormat));
@ -76,13 +77,19 @@ void reporter_printstats( Transfer_Info *stats ) {
if ( stats->mUDP != (char)kMode_Server ) {
// TCP Reporting
printf( report_bw_header);
if( !header_printed ) {
printf( report_bw_header);
header_printed = 1;
}
printf( report_bw_format, stats->transferID,
stats->startTime, stats->endTime,
buffer, &buffer[sizeof(buffer)/2] );
} else {
// UDP Reporting
printf( report_bw_jitter_loss_header);
if( !header_printed ) {
printf( report_bw_jitter_loss_header);
header_printed = 1;
}
printf( report_bw_jitter_loss_format, stats->transferID,
stats->startTime, stats->endTime,
buffer, &buffer[sizeof(buffer)/2],