aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2012-09-28 10:08:17 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2012-09-28 10:08:17 +0000
commit99e665dcd4700a33dc2022e21b701e93db86b4fa (patch)
tree3a5171bc7e73a87954f830e6755c1efaa0598661 /file.c
parenta3f9f5f7da62ef328b67663797401f7825f051f0 (diff)
Revert r45183:r45184
r45182 was good fix, but updae frames_count when redissecting. svn path=/trunk/; revision=45189
Diffstat (limited to 'file.c')
-rw-r--r--file.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/file.c b/file.c
index f409f4ecd6..52083fb23a 100644
--- a/file.c
+++ b/file.c
@@ -1227,7 +1227,7 @@ read_packet(capture_file *cf, dfilter_t *dfcode,
cf->packet_comment_count++;
cf->f_datalen = offset + fdlocal.cap_len;
- if (!cf->rescanning) {
+ if (!cf->redissecting) {
row = add_packet_to_packet_list(fdata, cf, dfcode,
filtering_tap_listeners, tap_flags,
pseudo_header, buf, TRUE, TRUE);
@@ -1776,6 +1776,7 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
guint tap_flags;
gboolean add_to_packet_list = FALSE;
gboolean compiled;
+ guint32 frames_count;
/* Compile the current display filter.
* We assume this will not fail since cf->dfilter is only set in
@@ -1804,17 +1805,16 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
screen updates while it happens. */
packet_list_freeze();
-
- /* We might receive new packets while redissecting, and we don't
- want to dissect those before their time. */
- cf->rescanning = TRUE;
-
if (redissect) {
/* We need to re-initialize all the state information that protocols
keep, because some preference that controls a dissector has changed,
which might cause the state information to be constructed differently
by that dissector. */
+ /* We might receive new packets while redissecting, and we don't
+ want to dissect those before their time. */
+ cf->redissecting = TRUE;
+
/* Cleanup all data structures used for dissection. */
cleanup_dissection();
/* Initialize all data structures used for dissection. */
@@ -1865,7 +1865,8 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
selected_frame_seen = FALSE;
- for (framenum = 1; framenum <= cf->count; framenum++) {
+ frames_count = cf->count;
+ for (framenum = 1; framenum <= frames_count; framenum++) {
fdata = frame_data_sequence_find(cf->frames, framenum);
/* Create the progress bar if necessary.
@@ -1888,11 +1889,11 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
* with count == 0, so let's assert that
*/
g_assert(cf->count > 0);
- progbar_val = (gfloat) count / cf->count;
+ progbar_val = (gfloat) count / frames_count;
if (progbar != NULL) {
g_snprintf(status_str, sizeof(status_str),
- "%4u of %u frames", count, cf->count);
+ "%4u of %u frames", count, frames_count);
update_progress_dlg(progbar, progbar_val, status_str);
}
@@ -1924,6 +1925,7 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
* "init_dissection()"), and null out the GSList pointer. */
fdata->flags.visited = 0;
frame_data_cleanup(fdata);
+ frames_count = cf->count;
}
if (redissect || refilter) {
@@ -1969,9 +1971,10 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
}
/* We are done redissecting the packet list. */
- cf->rescanning = FALSE;
+ cf->redissecting = FALSE;
if (redissect) {
+ frames_count = cf->count;
/* Clear out what remains of the visited flags and per-frame data
pointers.
@@ -1981,7 +1984,7 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
even though the user requested that the scan stop, and that
would leave the user stuck with an Wireshark grinding on
until it finishes. Should we just stick them with that? */
- for (; framenum <= cf->count; framenum++) {
+ for (; framenum <= frames_count; framenum++) {
fdata = frame_data_sequence_find(cf->frames, framenum);
fdata->flags.visited = 0;
frame_data_cleanup(fdata);