summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imfile/imfile.c5
-rw-r--r--plugins/imuxsock/imuxsock.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
index fd15918c..6eecd9af 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -337,12 +337,15 @@ persistStrmState(fileInfo_t *pInfo)
{
DEFiRet;
strm_t *psSF = NULL; /* state file (stream) */
+ size_t lenDir;
ASSERT(pInfo != NULL);
/* TODO: create a function persistObj in obj.c? */
CHKiRet(strm.Construct(&psSF));
- CHKiRet(strm.SetDir(psSF, glbl.GetWorkDir(), strlen((char*)glbl.GetWorkDir())));
+ lenDir = ustrlen(glbl.GetWorkDir());
+ if(lenDir > 0)
+ CHKiRet(strm.SetDir(psSF, glbl.GetWorkDir(), lenDir));
CHKiRet(strm.SettOperationsMode(psSF, STREAMMODE_WRITE_TRUNC));
CHKiRet(strm.SetsType(psSF, STREAMTYPE_FILE_SINGLE));
CHKiRet(strm.SetFName(psSF, pInfo->pszStateFile, strlen((char*) pInfo->pszStateFile)));
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
index c248b3d6..c1168c87 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -283,7 +283,7 @@ addLstnSocketName(void __attribute__((unused)) *pVal, uchar *pNewVal)
}
CHKiRet(prop.ConstructFinalize(listeners[nfd].hostName));
if(ratelimitInterval > 0) {
- if((listeners[nfd].ht = create_hashtable(1000, hash_from_key_fn, key_equals_fn, NULL)) == NULL) {
+ if((listeners[nfd].ht = create_hashtable(100, hash_from_key_fn, key_equals_fn, NULL)) == NULL) {
/* in this case, we simply turn of rate-limiting */
dbgprintf("imuxsock: turning off rate limiting because we could not "
"create hash table\n");
@@ -761,7 +761,7 @@ CODESTARTwillRun
if(pLogSockName != NULL)
listeners[0].sockName = pLogSockName;
if(ratelimitIntervalSysSock > 0) {
- if((listeners[0].ht = create_hashtable(1000, hash_from_key_fn, key_equals_fn, NULL)) == NULL) {
+ if((listeners[0].ht = create_hashtable(100, hash_from_key_fn, key_equals_fn, NULL)) == NULL) {
/* in this case, we simply turn of rate-limiting */
dbgprintf("imuxsock: turning off rate limiting because we could not "
"create hash table\n");