From 4eda5a54938140c6602a41c702340fbb7f9ac5bf Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 15 Oct 2007 06:23:58 +0000 Subject: changed ommsyql to allow for ":ommysql:" module specific action call method instead of ">". This shall facilitate the creation of other plugins. --- plugins/ommysql/ommysql.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'plugins/ommysql') diff --git a/plugins/ommysql/ommysql.c b/plugins/ommysql/ommysql.c index 477da213..8cc4f516 100644 --- a/plugins/ommysql/ommysql.c +++ b/plugins/ommysql/ommysql.c @@ -222,8 +222,19 @@ BEGINparseSelectorAct int iMySQLPropErr = 0; CODESTARTparseSelectorAct CODE_STD_STRING_REQUESTparseSelectorAct(1) - /* first check if this config line is actually for us */ - if(*p != '>') { + /* first check if this config line is actually for us + * The first test [*p == '>'] can be skipped if a module shall only + * support the newer slection syntax [:modname:]. This is in fact + * recommended for new modules. Please note that over time this part + * will be handled by rsyslogd itself, but for the time being it is + * a good compromise to do it at the module level. + * rgerhards, 2007-10-15 + */ + if(*p == '>') { + p++; /* eat '>' '*/ + } else if(!strncmp((char*) p, ":ommysql:", sizeof(":ommysql:") - 1)) { + p += sizeof(":ommysql:"); /* eat indicator sequence */ + } else { ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); } @@ -231,7 +242,6 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1) if((iRet = createInstance(&pData)) != RS_RET_OK) goto finalize_it; - p++; /* eat '>' '*/ /* rger 2004-10-28: added support for MySQL * >server,dbname,userid,password -- cgit