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/nssel.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/nssel.c')
-rw-r--r-- | runtime/nssel.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/runtime/nssel.c b/runtime/nssel.c index 751dae9b..6ca0f262 100644 --- a/runtime/nssel.c +++ b/runtime/nssel.c @@ -127,6 +127,29 @@ finalize_it: } +/* 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(nssel_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; +} + + /* Add a stream object to the current select() set. * Note that a single stream may have multiple "sockets" if * it is a listener. If so, all of them are begin added. @@ -195,6 +218,7 @@ CODESTARTobjQueryInterface(nssel) pIf->Construct = nsselConstruct; pIf->ConstructFinalize = ConstructFinalize; pIf->Destruct = nsselDestruct; + pIf->SetDrvrName = SetDrvrName; pIf->Add = Add; pIf->Wait = Wait; pIf->IsReady = IsReady; |