From: maxtors Date: Thu, 7 May 2015 12:09:04 +0000 (+0200) Subject: Changed naming of flowmanager/recycler. X-Git-Tag: suricata-3.1RC1~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6adb5dbbf9cf4ac634f9f85d551a4c777676813;p=thirdparty%2Fsuricata.git Changed naming of flowmanager/recycler. - 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. --- diff --git a/src/flow-manager.c b/src/flow-manager.c index 9b9920eb4d..864668580f 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -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++; diff --git a/src/tm-threads.c b/src/tm-threads.c index a1cf5528fb..ad460232a7 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -1793,6 +1793,7 @@ void TmThreadFree(ThreadVars *tv) } TmThreadsUnregisterThread(tv->id); + SCFree(tv->name); SCFree(tv); }