aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2019-07-20 22:24:56 +0100
committerMartin Kaiser <wireshark@kaiser.cx>2019-07-21 17:00:18 +0000
commita80b4fdd409dec75e96475f9d17034788e296b88 (patch)
tree8d27f5a6f1a28bbabf4806ee8d1657e3eb07ad50 /epan/wslua
parent4e2a63f54379a42e85ccc2f39834dc120f136b94 (diff)
Lua: remove lua_data_handle
Use call_data_dissector directly for the same effect as lua_data_handle. Remove the special case where DissectorTable.get_dissector() returns the data dissector for an unsupported type. The documentation says that nil is returned if the handle is not found, that seems more appropriate. Change-Id: I128ef90b79bda925a4329202a0b9956e1cf16200 Reviewed-on: https://code.wireshark.org/review/34032 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/wslua')
-rw-r--r--epan/wslua/init_wslua.c4
-rw-r--r--epan/wslua/wslua.h1
-rw-r--r--epan/wslua/wslua_dissector.c4
3 files changed, 2 insertions, 7 deletions
diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c
index 2243f8fd8f..b2c5c41d22 100644
--- a/epan/wslua/init_wslua.c
+++ b/epan/wslua/init_wslua.c
@@ -124,8 +124,6 @@ static expert_field ei_lua_proto_deprecated_note = EI_INIT;
static expert_field ei_lua_proto_deprecated_warn = EI_INIT;
static expert_field ei_lua_proto_deprecated_error = EI_INIT;
-dissector_handle_t lua_data_handle;
-
static gboolean
lua_pinfo_end(wmem_allocator_t *allocator _U_, wmem_cb_event_t event _U_,
void *user_data _U_)
@@ -1037,8 +1035,6 @@ void wslua_init(register_cb cb, gpointer client_data) {
lua_tree = NULL;
lua_tvb = NULL;
- lua_data_handle = find_dissector("data");
-
Proto_commit(L);
first_time = FALSE;
diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h
index c9c00f449c..06b63215bd 100644
--- a/epan/wslua/wslua.h
+++ b/epan/wslua/wslua.h
@@ -703,7 +703,6 @@ extern C shift##C(lua_State* L,int i)
extern packet_info* lua_pinfo;
extern TreeItem lua_tree;
extern tvbuff_t* lua_tvb;
-extern dissector_handle_t lua_data_handle;
extern gboolean lua_initialized;
extern int lua_dissectors_table_ref;
extern int lua_heur_dissectors_table_ref;
diff --git a/epan/wslua/wslua_dissector.c b/epan/wslua/wslua_dissector.c
index cce72331e5..6a692fc14d 100644
--- a/epan/wslua/wslua_dissector.c
+++ b/epan/wslua/wslua_dissector.c
@@ -561,7 +561,7 @@ WSLUA_METHOD DissectorTable_try (lua_State *L) {
}
if (!handled) {
- len = call_dissector(lua_data_handle,tvb->ws_tvb,pinfo->ws_pinfo,ti->tree);
+ len = call_data_dissector(tvb->ws_tvb, pinfo->ws_pinfo, ti->tree);
}
/* XXX Are we sure about this??? is this the right/only thing to catch */
} CATCH_NONFATAL_ERRORS {
@@ -583,7 +583,7 @@ WSLUA_METHOD DissectorTable_get_dissector (lua_State *L) {
DissectorTable dt = checkDissectorTable(L,1);
ftenum_t type;
- dissector_handle_t handle = lua_data_handle;
+ dissector_handle_t handle = NULL;
if (!dt) return 0;