aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2009-08-10 20:52:56 +0000
committerAnders Broman <anders.broman@ericsson.com>2009-08-10 20:52:56 +0000
commitca335d25cbb5594cd91261e6b4779e584e32d858 (patch)
treea820190d146c759a05ff9678bba6fde12ff63700 /file.c
parent72d8e6ad54b313543af07d459be1b35846648478 (diff)
From Kovarththanan Rajaratnam:
- Compute and cache color/custom filters dynamically. - Delay column construction. svn path=/trunk/; revision=29370
Diffstat (limited to 'file.c')
-rw-r--r--file.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/file.c b/file.c
index 49e00156fe..620242d75c 100644
--- a/file.c
+++ b/file.c
@@ -1003,6 +1003,13 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
gint row;
gboolean create_proto_tree = FALSE;
epan_dissect_t *edt;
+ column_info *cinfo;
+
+#ifdef NEW_PACKET_LIST
+ cinfo = (tap_flags & TL_REQUIRES_COLUMNS) ? &cf->cinfo : NULL;
+#else
+ cinfo = &cf->cinfo;
+#endif
/* just add some value here until we know if it is being displayed or not */
fdata->cum_bytes = cum_bytes + fdata->pkt_len;
@@ -1057,9 +1064,12 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
allocate a protocol tree root node, so that we'll construct
a protocol tree against which a filter expression can be
evaluated. */
- if ((dfcode != NULL && refilter) || color_filters_used() ||
- filtering_tap_listeners || (tap_flags & TL_REQUIRES_PROTO_TREE) ||
- have_custom_cols(&cf->cinfo))
+ if ((dfcode != NULL && refilter) ||
+#ifndef NEW_PACKET_LIST
+ color_filters_used() ||
+ have_custom_cols(cinfo) ||
+#endif
+ filtering_tap_listeners || (tap_flags & TL_REQUIRES_PROTO_TREE))
create_proto_tree = TRUE;
/* Dissect the frame. */
@@ -1068,15 +1078,15 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
if (dfcode != NULL && refilter) {
epan_dissect_prime_dfilter(edt, dfcode);
}
- /* prepare color filters */
- if (color_filters_used()) {
- color_filters_prime_edt(edt);
- }
- col_custom_prime_edt(edt, &cf->cinfo);
+ /* prepare color filters */
+#ifndef NEW_PACKET_LIST
+ color_filters_prime_edt(edt);
+ col_custom_prime_edt(edt, cinfo);
+#endif
tap_queue_init(edt);
- epan_dissect_run(edt, pseudo_header, buf, fdata, &cf->cinfo);
+ epan_dissect_run(edt, pseudo_header, buf, fdata, cinfo);
tap_push_tapped_queue(edt);
/* If we have a display filter, apply it if we're refiltering, otherwise
@@ -1129,14 +1139,9 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
cf->last_displayed = fdata;
#ifdef NEW_PACKET_LIST
- /* This function returns the color_t that was applied to the packet (in
- * the old packet list). Applying the color to the packet is only done
- * in the following function when not using the new packet list. */
- fdata->color_filter = color_filters_colorize_packet(0, edt);
-
- row = new_packet_list_append(&cf->cinfo, fdata, &edt->pi);
+ row = new_packet_list_append(cinfo, fdata, &edt->pi);
#else
- row = packet_list_append(cf->cinfo.col_data, fdata);
+ row = packet_list_append(cinfo->col_data, fdata);
/* colorize packet: first apply color filters
* then if packet is marked, use preferences to overwrite color