From 16941468ceb4f7b33ce7a7873406c04106ce650a Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 15 Nov 2014 16:46:21 +0100 Subject: [PATCH] lua: in streaming api, indicate open/close The SCStreamingBuffer call now also returns two booleans: data, data_open, data_close = SCStreamingBuffer() The first indicates this is the first data of this type for this TCP session or HTTP transaction. The second indicates this is the last data. Ticket #1317. --- src/util-lua-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util-lua-common.c b/src/util-lua-common.c index 54c236de87..82013485f2 100644 --- a/src/util-lua-common.c +++ b/src/util-lua-common.c @@ -113,7 +113,9 @@ static int LuaCallbackStreamingBufferPushToStack(lua_State *luastate, const LuaS { //PrintRawDataFp(stdout, (uint8_t *)b->data, b->data_len); lua_pushlstring (luastate, (const char *)b->data, b->data_len); - return 1; + lua_pushboolean (luastate, (b->flags & OUTPUT_STREAMING_FLAG_OPEN)); + lua_pushboolean (luastate, (b->flags & OUTPUT_STREAMING_FLAG_CLOSE)); + return 3; } /** \internal