diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2007-03-23 18:08:17 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2007-03-23 18:08:17 +0000 |
commit | 6d8d2854c8cf998605e041987610986d09375c6a (patch) | |
tree | 49c7db39b4c44d02429daa16149f2ba63678af4e /file.c | |
parent | 62f88a4a04d8e300ff108f6164e9016e8cdcc9c3 (diff) | |
download | wireshark-6d8d2854c8cf998605e041987610986d09375c6a.tar.gz |
From Sake Blok:
Fix for bug #491: Unexpected frame.time_delta behavior
This patch ... fixes bug 491. It does this by changing the
behaviour of the frame.time_delta field so it reflects the delta
time between captured packets (tshark already did this). To keep
the delta time between displayed packets, the field
frame.time_delta_displayed is created.
svn path=/trunk/; revision=21154
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -83,7 +83,7 @@ gboolean auto_scroll_live; #endif static nstime_t first_ts; -static nstime_t prev_ts; +static nstime_t prev_dis_ts; static guint32 cum_bytes = 0; static void cf_reset_state(capture_file *cf); @@ -253,7 +253,7 @@ cf_open(capture_file *cf, const char *fname, gboolean is_tempfile, int *err) cf->has_snap = TRUE; nstime_set_zero(&cf->elapsed_time); nstime_set_zero(&first_ts); - nstime_set_zero(&prev_ts); + nstime_set_zero(&prev_dis_ts); cf->plist_chunk = g_mem_chunk_new("frame_data_chunk", sizeof(frame_data), @@ -908,8 +908,8 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf, it's because this is the first displayed packet. Save the time stamp of this packet as the time stamp of the previous displayed packet. */ - if (nstime_is_zero(&prev_ts)) { - prev_ts = fdata->abs_ts; + if (nstime_is_zero(&prev_dis_ts)) { + prev_dis_ts = fdata->abs_ts; } /* Get the time elapsed between the first packet and this packet. */ @@ -925,7 +925,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf, /* Get the time elapsed between the previous displayed packet and this packet. */ - nstime_delta(&fdata->del_ts, &fdata->abs_ts, &prev_ts); + nstime_delta(&fdata->del_dis_ts, &fdata->abs_ts, &prev_dis_ts); /* If either @@ -1015,7 +1015,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf, /* Set the time of the previous displayed frame to the time of this frame. */ - prev_ts = fdata->abs_ts; + prev_dis_ts = fdata->abs_ts; cf->displayed_count++; } else { @@ -1059,6 +1059,10 @@ read_packet(capture_file *cf, dfilter_t *dfcode, gint64 offset) fdata->color_filter = NULL; fdata->abs_ts = *((nstime_t *) &phdr->ts); + if (cf->plist_end != NULL) + nstime_delta(&fdata->del_cap_ts, &fdata->abs_ts, &cf->plist_end->abs_ts); + else + nstime_set_zero(&fdata->del_cap_ts); passed = TRUE; if (cf->rfcode) { @@ -1495,7 +1499,7 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item, to check whether it should be displayed and, if so, add it to the display list. */ nstime_set_zero(&first_ts); - nstime_set_zero(&prev_ts); + nstime_set_zero(&prev_dis_ts); /* Update the progress bar when it gets to this value. */ progbar_nextstep = 0; |