]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Changed naming of flowmanager/recycler.
authormaxtors <moe.andreas@gmail.com>
Thu, 7 May 2015 12:09:04 +0000 (14:09 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 2 May 2016 08:10:40 +0000 (10:10 +0200)
- Changed FlowManagerThread to FM-
- Changed FlowRecyclerThread to FR-
- Changed use of strcasecmp to strncasecmp. This was used in the
  killing and disabling of FM/FR Threads.

src/flow-manager.c
src/tm-threads.c

index 9b9920eb4d1b004aa31eeab48322788b28fca069..864668580f803ea83dc8b9b2bc4bb589e1218888 100644 (file)
@@ -122,7 +122,7 @@ void FlowDisableFlowManagerThread(void)
     tv = tv_root[TVT_MGMT];
 
     while (tv != NULL) {
-        if (strcasecmp(tv->name, "FlowManagerThread") == 0) {
+        if (strncasecmp(tv->name, "FM", 2) == 0) {
             TmThreadsSetFlag(tv, THV_KILL);
             cnt++;
 
@@ -734,10 +734,10 @@ void FlowManagerThreadSpawn()
     for (u = 0; u < flowmgr_number; u++) {
         ThreadVars *tv_flowmgr = NULL;
 
-        char name[32];
-        snprintf(name, sizeof(name), "FlowManagerThread%02u", u+1);
+        char name[32] = "";
+        snprintf(name, sizeof(name), "FM%02u", u+1);
 
-        tv_flowmgr = TmThreadCreateMgmtThreadByName("FlowManagerThread",
+        tv_flowmgr = TmThreadCreateMgmtThreadByName(SCStrdup(name),
                 "FlowManager", 0);
         BUG_ON(tv_flowmgr == NULL);
 
@@ -897,10 +897,15 @@ void FlowRecyclerThreadSpawn()
     for (u = 0; u < flowrec_number; u++) {
         ThreadVars *tv_flowmgr = NULL;
 
+<<<<<<< HEAD
         char name[32];
         snprintf(name, sizeof(name), "FlowRecyclerThread%02u", u+1);
+=======
+        char name[32] = "";
+        snprintf(name, sizeof(name), "FR%02u", u+1);
+>>>>>>> Changed naming of flowmanager/recycler.
 
-        tv_flowmgr = TmThreadCreateMgmtThreadByName("FlowRecyclerThread",
+        tv_flowmgr = TmThreadCreateMgmtThreadByName(SCStrdup(name),
                 "FlowRecycler", 0);
         BUG_ON(tv_flowmgr == NULL);
 
@@ -952,7 +957,7 @@ void FlowDisableFlowRecyclerThread(void)
     tv = tv_root[TVT_MGMT];
 
     while (tv != NULL) {
-        if (strcasecmp(tv->name, "FlowRecyclerThread") == 0) {
+        if (strncasecmp(tv->name, "FR", 2) == 0) {
             TmThreadsSetFlag(tv, THV_KILL);
             cnt++;
 
index a1cf5528fb0e16a05a5f1619b9d11ac80845bd72..ad460232a781455ffb7f220b074b8929d88b80ed 100644 (file)
@@ -1793,6 +1793,7 @@ void TmThreadFree(ThreadVars *tv)
     }
 
     TmThreadsUnregisterThread(tv->id);
+    SCFree(tv->name);
     SCFree(tv);
 }