diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-08-05 19:09:44 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-08-05 19:09:44 +0000 |
commit | f4bcbeb9f26874ab763e78056638541a5b371cde (patch) | |
tree | 0cfd0c6f58226d6d85bdc0613cdcbfc97432e228 /epan/dissectors/packet-bfcp.c | |
parent | d3af98bb91b83d58b03a6264423b658af111d44b (diff) | |
download | wireshark-f4bcbeb9f26874ab763e78056638541a5b371cde.tar.gz |
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-bfcp.c')
-rw-r--r-- | epan/dissectors/packet-bfcp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-bfcp.c b/epan/dissectors/packet-bfcp.c index 1ce174378d..3eaf4dfa86 100644 --- a/epan/dissectors/packet-bfcp.c +++ b/epan/dissectors/packet-bfcp.c @@ -77,6 +77,8 @@ static gint ett_bfcp_attr = -1; static expert_field ei_bfcp_attribute_length_too_small = EI_INIT; +static dissector_handle_t bfcp_handle; + /* Initialize BFCP primitives */ static const value_string map_bfcp_primitive[] = { { 0, "<Invalid Primitive>"}, @@ -667,7 +669,7 @@ void proto_register_bfcp(void) proto_bfcp = proto_register_protocol("Binary Floor Control Protocol", "BFCP", "bfcp"); - register_dissector("bfcp", dissect_bfcp, proto_bfcp); + bfcp_handle = register_dissector("bfcp", dissect_bfcp, proto_bfcp); bfcp_module = prefs_register_protocol(proto_bfcp, proto_reg_handoff_bfcp); @@ -695,11 +697,8 @@ void proto_reg_handoff_bfcp(void) */ if (!prefs_initialized) { - dissector_handle_t bfcp_handle; - heur_dissector_add("tcp", dissect_bfcp_heur, proto_bfcp); heur_dissector_add("udp", dissect_bfcp_heur, proto_bfcp); - bfcp_handle = create_dissector_handle(dissect_bfcp, proto_bfcp); dissector_add_handle("tcp.port", bfcp_handle); dissector_add_handle("udp.port", bfcp_handle); prefs_initialized = TRUE; |