aboutsummaryrefslogtreecommitdiffstats
path: root/timestats.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2003-09-03 10:10:18 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2003-09-03 10:10:18 +0000
commit25493878d94ab97a34eff9032f5d23fbe133854a (patch)
treeba251eda87a4062d5090a3d4bb3bf3296ccbada5 /timestats.c
parent672b08166cd0dbcda6db1e81657374c300b3511a (diff)
fix to various stats tables.
The code used to rely on min_time==0 to determine whether this was the first packet or not and whereby we had to initialize min_time to the current value. This obviously does not work for capture files with poor timestamp resolution where the response time is actually, according to the capture file, 0 and we got all sorts of weird effects like average response time being less than the minimum response time. note, the bug only affected the minimum response time in the tables and not max or average response time. it would "miss" tose minimum response times that were ==0 and display the minumin response time in the capture that were >0 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8358 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'timestats.c')
-rw-r--r--timestats.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/timestats.c b/timestats.c
index 0a09f3a38e..5593c26d89 100644
--- a/timestats.c
+++ b/timestats.c
@@ -2,7 +2,7 @@
* routines for time statistics
* Copyrigth 2003 Lars Roland
*
- * $Id: timestats.c,v 1.1 2003/04/16 07:24:04 guy Exp $
+ * $Id: timestats.c,v 1.2 2003/09/03 10:10:17 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -70,15 +70,13 @@ gdouble nstime_to_msec(nstime_t *time)
void
time_stat_update(timestat_t *stats, nstime_t *delta, packet_info *pinfo)
{
- if((stats->max.secs==0)
- && (stats->max.nsecs==0) ){
+ if(stats->num==0){
stats->max.secs=delta->secs;
stats->max.nsecs=delta->nsecs;
stats->max_num=pinfo->fd->num;
}
- if((stats->min.secs==0)
- && (stats->min.nsecs==0) ){
+ if(stats->num==0){
stats->min.secs=delta->secs;
stats->min.nsecs=delta->nsecs;
stats->min_num=pinfo->fd->num;