Skip to content

Commit

Permalink
streaming/lua: add direction indication to streamer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
victorjulien committed Jun 3, 2017
1 parent 35edc52 commit 5b1d8c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/util-lua-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,17 @@ 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)
{
//PrintRawDataFp(stdout, (uint8_t *)b->data, b->data_len);
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
Expand Down

0 comments on commit 5b1d8c7

Please sign in to comment.