diff options
-rw-r--r-- | dependencies/nDPIsrvd.h | 2 | ||||
-rw-r--r-- | examples/c-captured/c-captured.c | 23 |
2 files changed, 5 insertions, 20 deletions
diff --git a/dependencies/nDPIsrvd.h b/dependencies/nDPIsrvd.h index f673a4d86..35f6133a3 100644 --- a/dependencies/nDPIsrvd.h +++ b/dependencies/nDPIsrvd.h @@ -644,7 +644,7 @@ static inline int nDPIsrvd_check_flow_end(struct nDPIsrvd_socket * const sock, struct nDPIsrvd_json_token const * const flow_event_name = TOKEN_GET_SZ(sock, "flow_event_name"); - if (TOKEN_VALUE_EQUALS_SZ(flow_event_name, "idle") != 0 && TOKEN_VALUE_EQUALS_SZ(flow_event_name, "end") != 0) + if (TOKEN_VALUE_EQUALS_SZ(flow_event_name, "idle") != 0 || TOKEN_VALUE_EQUALS_SZ(flow_event_name, "end") != 0) { if (sock->flow_end_callback != NULL) { diff --git a/examples/c-captured/c-captured.c b/examples/c-captured/c-captured.c index a427a38fc..836cbd4c0 100644 --- a/examples/c-captured/c-captured.c +++ b/examples/c-captured/c-captured.c @@ -297,24 +297,6 @@ static enum nDPIsrvd_callback_return captured_json_callback(struct nDPIsrvd_sock struct flow_user_data * const flow_user = (struct flow_user_data *)flow->flow_user_data; -#ifdef VERBOSE - struct nDPIsrvd_json_token * current_token = NULL; - struct nDPIsrvd_json_token * jtmp = NULL; - - HASH_ITER(hh, sock->json.token_table, current_token, jtmp) - { - if (current_token->value != NULL) - { - printf("[%.*s : %.*s] ", - current_token->key_length, - current_token->key, - current_token->value_length, - current_token->value); - } - } - printf("EoF\n"); -#endif - if (flow_user == NULL || flow_user->detection_finished != 0) { return CALLBACK_OK; @@ -450,6 +432,9 @@ static void captured_flow_end_callback(struct nDPIsrvd_socket * const sock, stru { (void)sock; +#ifdef VERBOSE + printf("flow %llu end, remaining flows: %u\n", flow->id_as_ull, sock->flow_table->hh.tbl->num_items); +#endif struct flow_user_data * const ud = (struct flow_user_data *)flow->flow_user_data; if (ud != NULL && ud->packets != NULL) { @@ -633,7 +618,7 @@ int main(int argc, char ** argv) { return 1; } - openlog("c-captured", LOG_CONS, LOG_DAEMON); + openlog("nDPIsrvd-captured", LOG_CONS, LOG_DAEMON); errno = 0; if (user != NULL && change_user_group(user, group, pidfile, datadir /* :D */, NULL) != 0) |