The data sources can be used even if the protocol tree isn't being built
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 25 Sep 2009 21:29:36 +0000 (21:29 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 25 Sep 2009 21:29:36 +0000 (21:29 +0000)
or isn't visible.

Clean up some indentation.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30158 f5534014-38df-0310-8fa8-9805f1628bb7

epan/packet.c

index 82d78ccb1c1f53cebc39e5fe109e21e1ef34b120..f54fe474e5ef70fbbaa43d437bbb7f7c828badce 100644 (file)
@@ -220,16 +220,23 @@ add_new_data_source(packet_info *pinfo, tvbuff_t *tvb, const char *name)
 
        src = ep_alloc(sizeof (data_source));
        src->tvb = tvb;
-    src->name_initialized = FALSE;
+       src->name_initialized = FALSE;
        src->name = name;
        pinfo->data_src = g_slist_append(pinfo->data_src, src);
 }
 
+/*
+ * This should only add a data source to the list of data sources for
+ * a frame if the data sources are being used.  Note that they can
+ * be used even if the protocol tree isn't being built or isn't visible,
+ * e.g. if you run tshark with -x but without -V or anything else to
+ * cause the protocol tree to be built.
+ */
 void
-packet_add_new_data_source(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, const char *name)
+packet_add_new_data_source(packet_info *pinfo, proto_tree *tree _U_,
+    tvbuff_t *tvb, const char *name)
 {
-       if (tree && PTREE_DATA(tree)->visible)
-               add_new_data_source(pinfo, tvb, name);
+       add_new_data_source(pinfo, tvb, name);
 }
 
 const char*