]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Counters: fix unix socket
authorVictor Julien <victor@inliniac.net>
Tue, 29 Oct 2013 07:29:11 +0000 (08:29 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 29 Oct 2013 07:29:11 +0000 (08:29 +0100)
src/counters.c
src/counters.h
src/unix-manager.c

index 5283ef7cee58975bba5e3addfb5c573d38e5dbdd..3a63b561ae5777ac0401298ec7c92155193be198 100644 (file)
@@ -724,9 +724,6 @@ TmEcode SCPerfOutputCounterSocket(json_t *cmd,
     uint64_t ui64_temp = 0;
     uint64_t ui64_result = 0;
 
-    double double_temp = 0;
-    double double_result = 0;
-
     uint32_t u = 0;
     int flag = 0;
 
@@ -769,7 +766,7 @@ TmEcode SCPerfOutputCounterSocket(json_t *cmd,
 
             SCMutexLock(&pctmi->head[u]->m);
 
-            while(pc_heads[u] != NULL && strcmp(pctmi->tm_name, pc_heads[u]->name->tm_name)) {
+            while(pc_heads[u] != NULL && strcmp(pctmi->tm_name, pc_heads[u]->tm_name)) {
                 pc_heads[u] = pc_heads[u]->next;
             }
         }
@@ -777,7 +774,6 @@ TmEcode SCPerfOutputCounterSocket(json_t *cmd,
         flag = 1;
         while(flag) {
             ui64_result = 0;
-            double_result = 0;
             if (pc_heads[0] == NULL)
                 break;
             pc = pc_heads[0];
@@ -793,7 +789,7 @@ TmEcode SCPerfOutputCounterSocket(json_t *cmd,
             }
 
             filled = 1;
-            json_object_set_new(jdata, pc->name->cname, json_integer(ui64_result));
+            json_object_set_new(jdata, pc->cname, json_integer(ui64_result));
         }
 
         for (u = 0; u < pctmi->size; u++)
index 64efcb2a3c58a45eb3cef69848d9a62a66ab61e0..a918ae4390b80ce48c5c136d33cc1c77f86e0abb 100644 (file)
@@ -62,14 +62,6 @@ enum {
     SC_PERF_IFACE_MAX,
 };
 
-/**
- * \brief Name of the counter.  Basically like a primary key for a counter
- */
-typedef struct SCPerfCounterName_ {
-    char *cname;
-    char *tm_name;
-} SCPerfCounterName;
-
 /**
  * \brief Container to hold the counter variable
  */
index b497d095d9be5e3773814155a696b0fdeb042c3f..5fc0054bc6ce8d7524d959f39ca0cd98561c4d32 100644 (file)
@@ -876,7 +876,7 @@ void *UnixManagerThread(void *td)
                 close(item->fd);
                 SCFree(item);
             }
-            SCPerfSyncCounters(th_v, 0);
+            SCPerfSyncCounters(th_v);
             break;
         }