summaryrefslogtreecommitdiffstats
path: root/tcps_sess.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-29 16:53:26 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-29 16:53:26 +0200
commitde84a12f8a5f140c0f7b8e00f4cac92ef13cd866 (patch)
treeeae06778ee37276778efe93db12f1172ba71b840 /tcps_sess.c
parent151c22e579d6de345d9ac7971ba1ba2f41b88976 (diff)
downloadrsyslog-de84a12f8a5f140c0f7b8e00f4cac92ef13cd866.tar.gz
rsyslog-de84a12f8a5f140c0f7b8e00f4cac92ef13cd866.tar.xz
rsyslog-de84a12f8a5f140c0f7b8e00f4cac92ef13cd866.zip
introduced the idea of detached properties
some things inside the message can be used over a large number of messages and need to to be allocated and re-written every time. I now begin to implement this as a "prop_t" object, first use for the inputName. Some input modules are already converted, some others to go. Will do a little performance check on the new method before I go further. Also, this commit has some cleanup and a few bug fixes that prevented compiliation in debug mode (I overlooked this as I did not compile for debug, what I normally do, and the automatted test also does not do that)
Diffstat (limited to 'tcps_sess.c')
-rw-r--r--tcps_sess.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tcps_sess.c b/tcps_sess.c
index e0bec949..4786e154 100644
--- a/tcps_sess.c
+++ b/tcps_sess.c
@@ -45,6 +45,7 @@
#include "netstrm.h"
#include "msg.h"
#include "datetime.h"
+#include "prop.h"
/* static data */
@@ -52,6 +53,7 @@ DEFobjStaticHelpers
DEFobjCurrIf(glbl)
DEFobjCurrIf(errmsg)
DEFobjCurrIf(netstrm)
+DEFobjCurrIf(prop)
DEFobjCurrIf(datetime)
static int iMaxLine; /* maximum size of a single message */
@@ -234,9 +236,9 @@ defaultDoSubmitMessage(tcps_sess_t *pThis, struct syslogTime *stTime, time_t ttG
/* we now create our own message object and submit it to the queue */
CHKiRet(msgConstructWithTime(&pMsg, stTime, ttGenTime));
-dbgprintf("defaultDoSubmit, iMsg %d\n", pThis->iMsg);
MsgSetRawMsg(pMsg, (char*)pThis->pMsg, pThis->iMsg);
- MsgSetInputName(pMsg, pThis->pLstnInfo->pszInputName, pThis->pLstnInfo->lenInputName);
+ prop.AddRef(pThis->pLstnInfo->pInputName);
+ MsgSetInputName(pMsg, pThis->pLstnInfo->pInputName);
MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY);
pMsg->msgFlags = NEEDS_PARSING | PARSE_HOSTNAME;
pMsg->bParseHOSTNAME = 1;
@@ -520,6 +522,7 @@ CODESTARTObjClassExit(tcps_sess)
objRelease(errmsg, CORE_COMPONENT);
objRelease(netstrm, LM_NETSTRMS_FILENAME);
objRelease(datetime, CORE_COMPONENT);
+ objRelease(prop, CORE_COMPONENT);
ENDObjClassExit(tcps_sess)
@@ -532,6 +535,7 @@ BEGINObjClassInit(tcps_sess, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANGE c
CHKiRet(objUse(errmsg, CORE_COMPONENT));
CHKiRet(objUse(netstrm, LM_NETSTRMS_FILENAME));
CHKiRet(objUse(datetime, CORE_COMPONENT));
+ CHKiRet(objUse(prop, CORE_COMPONENT));
CHKiRet(objUse(glbl, CORE_COMPONENT));
iMaxLine = glbl.GetMaxLine(); /* get maximum size we currently support */