diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-09-17 15:01:30 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-09-17 15:01:30 +0200 |
commit | 33bb5517ba3a47b95e69b3a155084e2a4ca31f7e (patch) | |
tree | 1450412894241e6c5849d809e939e176c5b9db96 /runtime/nspoll.c | |
parent | ad50194ceb52bcf45566f98b801d72163a005718 (diff) | |
download | rsyslog-33bb5517ba3a47b95e69b3a155084e2a4ca31f7e.tar.gz rsyslog-33bb5517ba3a47b95e69b3a155084e2a4ca31f7e.tar.bz2 rsyslog-33bb5517ba3a47b95e69b3a155084e2a4ca31f7e.zip |
imtcp: add streamdriver.name module parameter
permits overriding the system default stream driver (gtls, ptcp)
Diffstat (limited to 'runtime/nspoll.c')
-rw-r--r-- | runtime/nspoll.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/runtime/nspoll.c b/runtime/nspoll.c index a936b255..43631f4e 100644 --- a/runtime/nspoll.c +++ b/runtime/nspoll.c @@ -66,7 +66,6 @@ loadDrvr(nspoll_t *pThis) uchar szDrvrName[48]; /* 48 shall be large enough */ pBaseDrvrName = pThis->pBaseDrvrName; - if(pBaseDrvrName == NULL) /* if no drvr name is set, use system default */ pBaseDrvrName = glbl.GetDfltNetstrmDrvr(); if(snprintf((char*)szDrvrName, sizeof(szDrvrName), "lmnsdpoll_%s", pBaseDrvrName) == sizeof(szDrvrName)) ABORT_FINALIZE(RS_RET_DRVRNAME_TOO_LONG); @@ -138,6 +137,29 @@ Wait(nspoll_t *pThis, int timeout, int *numEntries, nsd_epworkset_t workset[]) { } +/* set the base driver name. If the driver name + * is set to NULL, the previously set name is deleted but + * no name set again (which results in the system default being + * used)-- rgerhards, 2008-05-05 + */ +static rsRetVal +SetDrvrName(nspoll_t *pThis, uchar *pszName) +{ + DEFiRet; + ISOBJ_TYPE_assert(pThis, netstrms); + if(pThis->pBaseDrvrName != NULL) { + free(pThis->pBaseDrvrName); + pThis->pBaseDrvrName = NULL; + } + + if(pszName != NULL) { + CHKmalloc(pThis->pBaseDrvrName = (uchar*) strdup((char*) pszName)); + } +finalize_it: + RETiRet; +} + + /* semantics like the epoll_ctl() function, does the same thing. * rgerhards, 2009-11-18 */ @@ -164,6 +186,7 @@ CODESTARTobjQueryInterface(nspoll) */ pIf->Construct = nspollConstruct; pIf->ConstructFinalize = ConstructFinalize; + pIf->SetDrvrName = SetDrvrName; pIf->Destruct = nspollDestruct; pIf->Wait = Wait; pIf->Ctl = Ctl; |