diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-05-05 14:19:12 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-05-05 14:19:12 +0200 |
commit | 7022e9019ebf9bf48ffd17ac11099f9cc2f22e4d (patch) | |
tree | f7cf32d138a95b1544d3643a1a18011c12115deb /runtime/netstrms.c | |
parent | 74ab20fa5cb95a90b46a4b423dc85b507f17ad8d (diff) | |
download | rsyslog-7022e9019ebf9bf48ffd17ac11099f9cc2f22e4d.tar.gz rsyslog-7022e9019ebf9bf48ffd17ac11099f9cc2f22e4d.tar.xz rsyslog-7022e9019ebf9bf48ffd17ac11099f9cc2f22e4d.zip |
support for different forwarding stream drivers added
they can now be set on an action-by-action basis
Diffstat (limited to 'runtime/netstrms.c')
-rw-r--r-- | runtime/netstrms.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/runtime/netstrms.c b/runtime/netstrms.c index 86157f5f..fde0788d 100644 --- a/runtime/netstrms.c +++ b/runtime/netstrms.c @@ -103,6 +103,10 @@ CODESTARTobjDestruct(netstrms) obj.ReleaseObj(__FILE__, pThis->pDrvrName+2, pThis->pDrvrName, (void*) &pThis->Drvr); free(pThis->pDrvrName); } + if(pThis->pBaseDrvrName != NULL) { + free(pThis->pBaseDrvrName); + pThis->pBaseDrvrName = NULL; + } ENDobjDestruct(netstrms) @@ -118,8 +122,30 @@ finalize_it: } -/* set the driver mode - * rgerhards, 2008-04-30 +/* 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(netstrms_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; +} + + +/* set the driver mode -- rgerhards, 2008-04-30 */ static rsRetVal SetDrvrMode(netstrms_t *pThis, int iMode) @@ -191,6 +217,7 @@ CODESTARTobjQueryInterface(netstrms) pIf->ConstructFinalize = netstrmsConstructFinalize; pIf->Destruct = netstrmsDestruct; pIf->CreateStrm = CreateStrm; + pIf->SetDrvrName = SetDrvrName; pIf->SetDrvrMode = SetDrvrMode; pIf->GetDrvrMode = GetDrvrMode; finalize_it: |