Rework Client::RunTCP so to update the stats for every packet if -i is set.
If -i is not set then the stats are only updated at the end of the run. This
was fallout of Andrew's patch.
diff --git a/ChangeLog b/ChangeLog
index 939cc0f..7e7125c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2008-03-12 Jon Dugan <jdugan@x1024.net>
+* Rework Client::RunTCP so to update the stats for every packet if -i is set.
+If -i is not set then the stats are only updated at the end of the run. This
+was fallout of Andrew's patch.
+
* Added -Wall to CXXFLAGS and CFLAGS. This generated a lot of noise in the
autotools generated files.
diff --git a/src/Client.cpp b/src/Client.cpp
index 50090df..e0a6950 100644
--- a/src/Client.cpp
+++ b/src/Client.cpp
@@ -163,6 +163,12 @@
}
totLen += currLen;
+ if(mSettings->mInterval > 0) {
+ gettimeofday( &(reportstruct->packetTime), NULL );
+ reportstruct->packetLen = currLen;
+ ReportPacket( mSettings->reporthdr, reportstruct );
+ }
+
if ( !mMode_Time ) {
mSettings->mAmount -= currLen;
}
@@ -172,8 +178,12 @@
// stop timing
gettimeofday( &(reportstruct->packetTime), NULL );
- reportstruct->packetLen = totLen;
- ReportPacket( mSettings->reporthdr, reportstruct );
+
+ // if we're not doing interval reporting, report the entire transfer as one big packet
+ if(0.0 == mSettings->mInterval) {
+ reportstruct->packetLen = totLen;
+ ReportPacket( mSettings->reporthdr, reportstruct );
+ }
CloseReport( mSettings->reporthdr, reportstruct );
DELETE_PTR( reportstruct );