flow json log: add 'shutdown' as flow end reason

When engine shuts down all flows in the hash are logged out. They
may not have timed out yet. So they are forced. Log the reason to
be 'shutdown'.
pull/1143/head
Victor Julien 11 years ago
parent bd1a193877
commit 4816dcc3d3

@ -435,7 +435,7 @@ static uint32_t FlowManagerHashRowCleanup(Flow *f)
else if (state == FLOW_STATE_CLOSED)
f->flow_end_flags |= FLOW_END_FLAG_STATE_CLOSED;
f->flow_end_flags |= FLOW_END_FLAG_TIMEOUT;
f->flow_end_flags |= FLOW_END_FLAG_SHUTDOWN;
/* no one is referring to this flow, use_cnt 0, removed from hash
* so we can unlock it and move it to the recycle queue. */

@ -184,6 +184,7 @@ typedef struct AppLayerParserState_ AppLayerParserState;
#define FLOW_END_FLAG_EMERGENCY 0x08
#define FLOW_END_FLAG_TIMEOUT 0x10
#define FLOW_END_FLAG_FORCED 0x20
#define FLOW_END_FLAG_SHUTDOWN 0x40
/** Mutex or RWLocks for the flow. */
//#define FLOWLOCK_RWLOCK

@ -229,6 +229,8 @@ static void JsonFlowLogJSON(JsonFlowLogThread *aft, json_t *js, Flow *f)
reason = "timeout";
else if (f->flow_end_flags & FLOW_END_FLAG_FORCED)
reason = "forced";
else if (f->flow_end_flags & FLOW_END_FLAG_SHUTDOWN)
reason = "shutdown";
json_object_set_new(hjs, "reason",
json_string(reason));

Loading…
Cancel
Save