aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua/wslua_proto.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2014-10-07 09:30:09 -0700
committerGerald Combs <gerald@wireshark.org>2014-10-07 16:34:18 +0000
commit9033f137a9e31dc9d8d77c3b1229580d1044604d (patch)
tree3469a02b444f4f0edbe304af0671169feed7b79b /epan/wslua/wslua_proto.c
parentacc09c2aa248d892ee6b894b43c79cb060131b11 (diff)
Revert "ASN1: Added support for using #.REGISTER_NEW"
This temporarily reverts commit acc09c2aa248d892ee6b894b43c79cb060131b11. Change-Id: I7a55c8c2da3f65e914b90648ee92c84efd57f1a0 Reviewed-on: https://code.wireshark.org/review/4525 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'epan/wslua/wslua_proto.c')
-rw-r--r--epan/wslua/wslua_proto.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c
index 6cb31dde52..b025cd8926 100644
--- a/epan/wslua/wslua_proto.c
+++ b/epan/wslua/wslua_proto.c
@@ -2086,12 +2086,12 @@ WSLUA_METHOD Dissector_call(lua_State* L) {
Pinfo pinfo = checkPinfo(L,WSLUA_ARG_Dissector_call_PINFO);
TreeItem ti = checkTreeItem(L,WSLUA_ARG_Dissector_call_TREE);
const char *volatile error = NULL;
- int len = 0;
+ int ret = 0;
if (! ( d && tvb && pinfo) ) return 0;
TRY {
- len = call_dissector(d, tvb->ws_tvb, pinfo->ws_pinfo, ti->tree);
+ ret = call_dissector(d, 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 {
show_exception(tvb->ws_tvb, pinfo->ws_pinfo, ti->tree, EXCEPT_CODE, GET_MESSAGE);
@@ -2100,7 +2100,7 @@ WSLUA_METHOD Dissector_call(lua_State* L) {
if (error) { WSLUA_ERROR(Dissector_call,error); }
- lua_pushnumber(L,(lua_Number)len);
+ lua_pushnumber(L,(lua_Number)ret);
WSLUA_RETURN(1); /* Number of bytes dissected. Note that some dissectors always return number of bytes in incoming buffer, so be aware. */
}
@@ -2503,7 +2503,6 @@ WSLUA_METHOD DissectorTable_try (lua_State *L) {
ftenum_t type;
gboolean handled = FALSE;
const gchar *volatile error = NULL;
- int len = 0;
if (! (dt && tvb && tvb->ws_tvb && pinfo && ti) ) return 0;
@@ -2514,28 +2513,25 @@ WSLUA_METHOD DissectorTable_try (lua_State *L) {
if (type == FT_STRING) {
const gchar* pattern = luaL_checkstring(L,WSLUA_ARG_DissectorTable_try_PATTERN);
- if (!pattern) {
+ if (!pattern)
handled = TRUE;
- } else {
- len = dissector_try_string(dt->table,pattern,tvb->ws_tvb,pinfo->ws_pinfo,ti->tree, NULL);
- if (len > 0) {
- handled = TRUE;
- }
- }
+
+ else if (dissector_try_string(dt->table,pattern,tvb->ws_tvb,pinfo->ws_pinfo,ti->tree, NULL))
+ handled = TRUE;
+
} else if ( type == FT_UINT32 || type == FT_UINT16 || type == FT_UINT8 || type == FT_UINT24 ) {
int port = luaL_checkint(L, WSLUA_ARG_DissectorTable_try_PATTERN);
- len = dissector_try_uint(dt->table,port,tvb->ws_tvb,pinfo->ws_pinfo,ti->tree);
- if (len > 0) {
+ if (dissector_try_uint(dt->table,port,tvb->ws_tvb,pinfo->ws_pinfo,ti->tree))
handled = TRUE;
- }
+
} else {
luaL_error(L,"No such type of dissector_table");
}
- if (!handled) {
- len = call_dissector(lua_data_handle,tvb->ws_tvb,pinfo->ws_pinfo,ti->tree);
- }
+ if (!handled)
+ call_dissector(lua_data_handle,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 {
show_exception(tvb->ws_tvb, pinfo->ws_pinfo, ti->tree, EXCEPT_CODE, GET_MESSAGE);
@@ -2544,8 +2540,7 @@ WSLUA_METHOD DissectorTable_try (lua_State *L) {
if (error) { WSLUA_ERROR(DissectorTable_try,error); }
- lua_pushnumber(L,(lua_Number)len);
- WSLUA_RETURN(1); /* Number of bytes dissected. Note that some dissectors always return number of bytes in incoming buffer, so be aware. */
+ return 0;
}
WSLUA_METHOD DissectorTable_get_dissector (lua_State *L) {