aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1999-08-26 07:01:44 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1999-08-26 07:01:44 +0000
commit43f00d7e16bfe55d76cda2d98c9a81e54af366dc (patch)
tree67b0e784b1fe92f69ccda200009be6c647ab1028 /file.c
parentcf6425a38cba9c869e232d5a7da153c6ee9770a4 (diff)
Introduces a new global gboolean variable: proto_tree_is_visible.
This is set before calling dissect_packet() to let the proto_tree routines whether or not it needs to go through the trouble of formatting strings. The use of this dramatically decreases the number of calls to vsnprintf. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@583 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/file.c b/file.c
index b29f2a69ae..69fb428162 100644
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.82 1999/08/25 00:03:59 gram Exp $
+ * $Id: file.c,v 1.83 1999/08/26 07:01:42 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -214,6 +214,7 @@ read_cap_file(capture_file *cf) {
timeout = gtk_timeout_add(250, file_progress_cb, (gpointer) cf);
freeze_clist(cf);
+ proto_tree_is_visible = FALSE;
success = wtap_loop(cf->wth, 0, wtap_dispatch_cb, (u_char *) cf, &err);
wtap_close(cf->wth);
cf->wth = NULL;
@@ -677,6 +678,8 @@ filter_packets(capture_file *cf)
cf->unfiltered_count = cf->count;
cf->count = 0;
+ proto_tree_is_visible = FALSE;
+
/* timeout = gtk_timeout_add(250, dfilter_progress_cb, cf);*/
for (fd = cf->plist; fd != NULL; fd = fd->next) {
cf->count++;
@@ -746,6 +749,8 @@ print_packets(capture_file *cf, int to_file, const char *dest)
print_preamble(cf->print_fh);
#endif
+ proto_tree_is_visible = TRUE;
+
/* Iterate through the list of packets, printing each of them. */
cf->count = 0;
for (fd = cf->plist; fd != NULL; fd = fd->next) {
@@ -900,6 +905,7 @@ select_packet(capture_file *cf, int row)
if (cf->protocol_tree)
proto_tree_free(cf->protocol_tree);
cf->protocol_tree = proto_tree_create_root();
+ proto_tree_is_visible = TRUE;
dissect_packet(cf->pd, cf->fd, cf->protocol_tree);
/* Display the GUI protocol tree and hex dump. */