mirror of
https://github.com/optim-enterprises-bv/nDPId.git
synced 2025-11-01 18:57:48 +00:00
@@ -148,7 +148,7 @@ static void csv_buf_add(csv_buf_t buf, size_t * const csv_buf_used, char const *
|
|||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
if (siz_len > 0 && str != NULL)
|
if (siz_len > 1 && str != NULL)
|
||||||
{
|
{
|
||||||
len = MIN(BUFFER_REMAINING(*csv_buf_used), siz_len);
|
len = MIN(BUFFER_REMAINING(*csv_buf_used), siz_len);
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
@@ -564,6 +564,8 @@ static int mainloop(void)
|
|||||||
|
|
||||||
int main(int argc, char ** argv)
|
int main(int argc, char ** argv)
|
||||||
{
|
{
|
||||||
|
init_logging("nDPIsrvd-analysed");
|
||||||
|
|
||||||
sock = nDPIsrvd_socket_init(0, 0, 0, 0, simple_json_callback, NULL, NULL);
|
sock = nDPIsrvd_socket_init(0, 0, 0, 0, simple_json_callback, NULL, NULL);
|
||||||
if (sock == NULL)
|
if (sock == NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -235,6 +235,10 @@ def onFlowCleanup(instance, current_flow, global_user_data):
|
|||||||
def onJsonLineRecvd(json_dict, instance, current_flow, global_user_data):
|
def onJsonLineRecvd(json_dict, instance, current_flow, global_user_data):
|
||||||
stats = global_user_data
|
stats = global_user_data
|
||||||
stats.update(json_dict, current_flow)
|
stats.update(json_dict, current_flow)
|
||||||
|
|
||||||
|
if 'packet_event_id' in json_dict:
|
||||||
|
return True
|
||||||
|
|
||||||
stats.resetStatus()
|
stats.resetStatus()
|
||||||
|
|
||||||
instance_and_source = ''
|
instance_and_source = ''
|
||||||
|
|||||||
6
utils.c
6
utils.c
@@ -144,6 +144,12 @@ int daemonize_with_pidfile(char const * const pidfile)
|
|||||||
|
|
||||||
if (daemonize != 0)
|
if (daemonize != 0)
|
||||||
{
|
{
|
||||||
|
if (pidfile == NULL)
|
||||||
|
{
|
||||||
|
logger_early(1, "%s", "Missing pidfile.");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_daemon_running(pidfile, ps) != 0)
|
if (is_daemon_running(pidfile, ps) != 0)
|
||||||
{
|
{
|
||||||
logger_early(1, "Pidfile %s found and daemon %s still running", pidfile, ps);
|
logger_early(1, "Pidfile %s found and daemon %s still running", pidfile, ps);
|
||||||
|
|||||||
Reference in New Issue
Block a user