void TmqhOutputFlowActivePackets(ThreadVars *t, Packet *p);
void TmqhOutputFlowRoundRobin(ThreadVars *t, Packet *p);
void *TmqhOutputFlowSetupCtx(char *queue_str);
+void TmqhOutputFlowFreeCtx(void *ctx);
void TmqhFlowRegisterTests(void);
TmqhFlowCtx *tmqh_flow_outctx = NULL;
tmqh_table[TMQH_FLOW].name = "flow";
tmqh_table[TMQH_FLOW].InHandler = TmqhInputFlow;
tmqh_table[TMQH_FLOW].OutHandlerCtxSetup = TmqhOutputFlowSetupCtx;
- tmqh_table[TMQH_FLOW].OutHandlerCtxFree = NULL;
+ tmqh_table[TMQH_FLOW].OutHandlerCtxFree = TmqhOutputFlowFreeCtx;
tmqh_table[TMQH_FLOW].RegisterTests = TmqhFlowRegisterTests;
char *scheduler = NULL;
return NULL;
}
+void TmqhOutputFlowFreeCtx(void *ctx)
+{
+ int i;
+ TmqhFlowCtx *fctx = (TmqhFlowCtx *)ctx;
+
+ for (i = 0; i < fctx->size; i++) {
+ SC_ATOMIC_DESTROY(fctx->queues[i].active_flows);
+ }
+
+ SCFree(fctx->queues);
+
+ tmqh_flow_outctx = NULL;
+
+ return;
+}
+
/**
* \brief select the queue to output in a round robin fashion.
*
retval = 1;
end:
+ if (fctx != NULL)
+ TmqhOutputFlowFreeCtx(fctx);
TmqResetQueues();
return retval;
}
retval = 1;
end:
+ if (fctx != NULL)
+ TmqhOutputFlowFreeCtx(fctx);
TmqResetQueues();
return retval;
}
retval = 1;
end:
+ if (fctx != NULL)
+ TmqhOutputFlowFreeCtx(fctx);
TmqResetQueues();
return retval;
}