diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-03-01 12:52:25 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-03-01 12:52:25 +0100 |
commit | eb3afa800033a9479be0f9abf282befe2d478e3f (patch) | |
tree | 787981116a9876cbbd5e6cd2074275a714a3cc5d /tools/omfile.c | |
parent | c2c1d7120c3bcb8f12ad281798973f23010c63f9 (diff) | |
parent | af6c73439ecef2446c5fae0d774a8c093e2a3747 (diff) | |
download | rsyslog-eb3afa800033a9479be0f9abf282befe2d478e3f.tar.gz rsyslog-eb3afa800033a9479be0f9abf282befe2d478e3f.tar.xz rsyslog-eb3afa800033a9479be0f9abf282befe2d478e3f.zip |
Merge branch 'v4-stable' into tmp
Diffstat (limited to 'tools/omfile.c')
-rw-r--r-- | tools/omfile.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/tools/omfile.c b/tools/omfile.c index 54221e0c..2499680d 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -5,10 +5,6 @@ * works! * * File begun on 2007-07-21 by RGerhards (extracted from syslogd.c) - * This file is under development and has not yet arrived at being fully - * self-contained and a real object. So far, it is mostly an excerpt - * of the "old" message code without any modifications. However, it - * helps to have things at the right place one we go to the meat of it. * * A large re-write of this file was done in June, 2009. The focus was * to introduce many more features (like zipped writing), clean up the code @@ -16,6 +12,10 @@ * solid basis for the next three to five years to come. During it, bugs * may have been introduced ;) -- rgerhards, 2009-06-04 * + * Note that as of 2010-02-28 this module does no longer handle + * pipes. These have been moved to ompipe, to reduced the entanglement + * between the two different functionalities. -- rgerhards + * * Copyright 2007-2009 Rainer Gerhards and Adiscon GmbH. * * This file is part of rsyslog. @@ -126,7 +126,7 @@ static int iZipLevel = 0; /* zip compression mode (0..9 as usual) */ static bool bFlushOnTXEnd = 1;/* flush write buffers when transaction has ended? */ static int64 iIOBufSize = IOBUF_DFLT_SIZE; /* size of an io buffer */ static int iFlushInterval = FLUSH_INTRVL_DFLT; /* how often flush the output buffer on inactivity? */ -static uchar *pszTplName = NULL; /* name of the default template to use */ +uchar *pszFileDfltTplName = NULL; /* name of the default template to use */ /* end globals for default values */ @@ -285,7 +285,7 @@ static rsRetVal cflineParseOutchannel(instanceData *pData, uchar* p, omodStringR pData->pszSizeLimitCmd = pOch->cmdOnSizeLimit; iRet = cflineParseTemplateName(&p, pOMSR, iEntry, iTplOpts, - (pszTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : pszTplName); + (pszFileDfltTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : pszFileDfltTplName); finalize_it: RETiRet; @@ -678,7 +678,7 @@ ENDdoAction BEGINparseSelectorAct CODESTARTparseSelectorAct - if(!(*p == '$' || *p == '?' || *p == '|' || *p == '/' || *p == '-')) + if(!(*p == '$' || *p == '?' || *p == '/' || *p == '-')) ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); CHKiRet(createInstance(&pData)); @@ -711,7 +711,7 @@ CODESTARTparseSelectorAct CODE_STD_STRING_REQUESTparseSelectorAct(2) ++p; /* eat '?' */ CHKiRet(cflineParseFileName(p, (uchar*) pData->f_fname, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, - (pszTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : pszTplName)); + (pszFileDfltTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : pszFileDfltTplName)); /* "filename" is actually a template name, we need this as string 1. So let's add it * to the pOMSR. -- rgerhards, 2007-07-27 */ @@ -724,7 +724,9 @@ CODESTARTparseSelectorAct calloc(iDynaFileCacheSize, sizeof(dynaFileCacheEntry*))); break; - case '|': + /* case '|': while pipe support has been removed, I leave the code in in case we + * need high-performance pipes at a later stage (unlikely). -- rgerhards, 2010-02-28 + */ case '/': CODE_STD_STRING_REQUESTparseSelectorAct(1) /* we now have *almost* the same semantics for files and pipes, but we still need @@ -739,7 +741,7 @@ CODESTARTparseSelectorAct } CHKiRet(cflineParseFileName(p, (uchar*) pData->f_fname, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, - (pszTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : pszTplName)); + (pszFileDfltTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : pszFileDfltTplName)); pData->bDynamicName = 0; break; default: @@ -797,9 +799,9 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a bFlushOnTXEnd = 1; iIOBufSize = IOBUF_DFLT_SIZE; iFlushInterval = FLUSH_INTRVL_DFLT; - if(pszTplName != NULL) { - free(pszTplName); - pszTplName = NULL; + if(pszFileDfltTplName != NULL) { + free(pszFileDfltTplName); + pszFileDfltTplName = NULL; } return RS_RET_OK; @@ -824,7 +826,7 @@ BEGINmodExit CODESTARTmodExit objRelease(errmsg, CORE_COMPONENT); objRelease(strm, CORE_COMPONENT); - free(pszTplName); + free(pszFileDfltTplName); ENDmodExit @@ -859,7 +861,7 @@ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(omsdRegCFSLineHdlr((uchar *)"failonchownfailure", 0, eCmdHdlrBinary, NULL, &bFailOnChown, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileForceChown", 0, eCmdHdlrBinary, NULL, &bForceChown, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionfileenablesync", 0, eCmdHdlrBinary, NULL, &bEnableSync, STD_LOADABLE_MODULE_ID)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionfiledefaulttemplate", 0, eCmdHdlrGetWord, NULL, &pszTplName, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionfiledefaulttemplate", 0, eCmdHdlrGetWord, NULL, &pszFileDfltTplName, NULL)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit /* vi:set ai: |