aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-hdfsdata.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-08-05 19:09:44 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-08-05 19:09:44 +0000
commitf4bcbeb9f26874ab763e78056638541a5b371cde (patch)
tree0cfd0c6f58226d6d85bdc0613cdcbfc97432e228 /epan/dissectors/packet-hdfsdata.c
parentd3af98bb91b83d58b03a6264423b658af111d44b (diff)
Keep result of [new_]register_dissector in some dissectors. [2 of x]
(don't create new dissector handle if we can use already existing one) svn path=/trunk/; revision=51159
Diffstat (limited to 'epan/dissectors/packet-hdfsdata.c')
-rw-r--r--epan/dissectors/packet-hdfsdata.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-hdfsdata.c b/epan/dissectors/packet-hdfsdata.c
index bbd670653c..fab9beb2d2 100644
--- a/epan/dissectors/packet-hdfsdata.c
+++ b/epan/dissectors/packet-hdfsdata.c
@@ -106,6 +106,8 @@ static int hf_hdfsdata_node = -1;
static gint ett_hdfsdata = -1;
+static dissector_handle_t hdfsdata_handle;
+
void proto_reg_handoff_hdfsdata(void);
/* Taken from HDFS
@@ -787,7 +789,7 @@ proto_register_hdfsdata(void)
10,
&tcp_port);
- register_dissector("hdfsdata", dissect_hdfsdata, proto_hdfsdata);
+ hdfsdata_handle = register_dissector("hdfsdata", dissect_hdfsdata, proto_hdfsdata);
}
/* registers handoff */
@@ -795,11 +797,9 @@ void
proto_reg_handoff_hdfsdata(void)
{
static gboolean initialized = FALSE;
- static dissector_handle_t hdfsdata_handle;
static guint saved_tcp_port;
if (!initialized) {
- hdfsdata_handle = create_dissector_handle(dissect_hdfsdata, proto_hdfsdata);
dissector_add_handle("tcp.port", hdfsdata_handle); /* for "decode as" */
initialized = TRUE;
} else if (saved_tcp_port != 0) {