output/flow: Eliminate unnecessary parameter

This commit removes a parameter to an internal-only function call.
Removing the parameter allows an JSON builder optimization to be used.
pull/5257/head
Jeff Lucovsky 5 years ago committed by Victor Julien
parent 4aa7c988e8
commit 60658cbe01

@ -63,7 +63,7 @@ typedef struct JsonFlowLogThread_ {
MemBuffer *buffer; MemBuffer *buffer;
} JsonFlowLogThread; } JsonFlowLogThread;
static JsonBuilder *CreateEveHeaderFromFlow(const Flow *f, const char *event_type) static JsonBuilder *CreateEveHeaderFromFlow(const Flow *f)
{ {
char timebuf[64]; char timebuf[64];
char srcip[46] = {0}, dstip[46] = {0}; char srcip[46] = {0}, dstip[46] = {0};
@ -118,9 +118,7 @@ static JsonBuilder *CreateEveHeaderFromFlow(const Flow *f, const char *event_typ
jb_set_string(jb, "in_iface", f->livedev->dev); jb_set_string(jb, "in_iface", f->livedev->dev);
} }
if (event_type) { JB_SET_STRING(jb, "event_type", "flow");
jb_set_string(jb, "event_type", event_type);
}
/* vlan */ /* vlan */
if (f->vlan_idx > 0) { if (f->vlan_idx > 0) {
@ -333,7 +331,7 @@ static int JsonFlowLogger(ThreadVars *tv, void *thread_data, Flow *f)
/* reset */ /* reset */
MemBufferReset(jhl->buffer); MemBufferReset(jhl->buffer);
JsonBuilder *jb = CreateEveHeaderFromFlow(f, "flow"); JsonBuilder *jb = CreateEveHeaderFromFlow(f);
if (unlikely(jb == NULL)) { if (unlikely(jb == NULL)) {
return TM_ECODE_OK; return TM_ECODE_OK;
} }

Loading…
Cancel
Save