From 5b1d8c7e94ef613107870d4d9d9cdde76d4c3438 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 2 Jun 2017 10:01:47 +0200 Subject: [PATCH] streaming/lua: add direction indication to streamer Call SCStreamingBuffer as follows: data, sb_open, sb_close, sb_ts, sb_tc = SCStreamingBuffer() sb_ts and sb_tc are bools indicating the direction of the data. --- src/util-lua-common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util-lua-common.c b/src/util-lua-common.c index f29dc48532e4..2b605aa236cc 100644 --- a/src/util-lua-common.c +++ b/src/util-lua-common.c @@ -108,7 +108,7 @@ void LuaPushTableKeyValueArray(lua_State *luastate, const char *key, const uint8 * \param p packet * \retval cnt number of data items placed on the stack * - * Places: payload (string) + * Places: payload (string), open (bool), close (bool), toserver (bool), toclient (bool) */ static int LuaCallbackStreamingBufferPushToStack(lua_State *luastate, const LuaStreamingBuffer *b) { @@ -116,7 +116,9 @@ static int LuaCallbackStreamingBufferPushToStack(lua_State *luastate, const LuaS lua_pushlstring (luastate, (const char *)b->data, b->data_len); lua_pushboolean (luastate, (b->flags & OUTPUT_STREAMING_FLAG_OPEN)); lua_pushboolean (luastate, (b->flags & OUTPUT_STREAMING_FLAG_CLOSE)); - return 3; + lua_pushboolean (luastate, (b->flags & OUTPUT_STREAMING_FLAG_TOSERVER)); + lua_pushboolean (luastate, (b->flags & OUTPUT_STREAMING_FLAG_TOCLIENT)); + return 5; } /** \internal