]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
lua: in streaming api, indicate open/close
authorVictor Julien <victor@inliniac.net>
Sat, 15 Nov 2014 15:46:21 +0000 (16:46 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 27 Nov 2014 15:22:52 +0000 (16:22 +0100)
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

index 54c236de87d363e0c6a774d7d3ffe351c8cffa88..82013485f2e303860c7109e8aaa098eb60f9d355 100644 (file)
@@ -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