summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-14 11:01:21 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-14 11:01:21 +0200
commitc5408da3d8f17691fb91282d031757ed041fec55 (patch)
tree4f932e801fac21ddc03616168106ac65411c340b /tools
parent4d70c9b3e5e480d6dfa1c94506270f1f78e8ef32 (diff)
downloadrsyslog-c5408da3d8f17691fb91282d031757ed041fec55.tar.gz
rsyslog-c5408da3d8f17691fb91282d031757ed041fec55.tar.xz
rsyslog-c5408da3d8f17691fb91282d031757ed041fec55.zip
new queue engine - initial commit (probably not 100% working!)
simplified and thus speeded up the queue engine, also fixed some potential race conditions (in very unusual shutdown conditions) along the way. The threading model has seriously changes, so there may be some regressions. NOTE: the code passed basic tests, but there is still more work and testing to be done. This commit should be treated with care.
Diffstat (limited to 'tools')
-rw-r--r--tools/syslogd.c9
-rw-r--r--tools/syslogd.h1
2 files changed, 7 insertions, 3 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 36a46175..89b90dec 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -158,6 +158,7 @@ DEFobjCurrIf(net) /* TODO: make go away! */
/* forward definitions */
static rsRetVal GlobalClassExit(void);
+static void logmsg(msg_t *pMsg, int flags);
#ifndef _PATH_LOGCONF
@@ -400,13 +401,16 @@ static int usage(void)
*/
/* return back the approximate current number of messages in the main message queue
+ * This number includes the messages that reside in an associated DA queue (if
+ * it exists) -- rgerhards, 2009-10-14
*/
rsRetVal
diagGetMainMsgQSize(int *piSize)
{
DEFiRet;
assert(piSize != NULL);
- *piSize = pMsgQueue->iQueueSize;
+ *piSize = (pMsgQueue->bIsDA) ? pMsgQueue->pqDA->iQueueSize : 0;
+ *piSize += pMsgQueue->iQueueSize;
RETiRet;
}
@@ -584,6 +588,7 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags)
MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName(), ustrlen(glbl.GetLocalHostName()));
MsgSetRcvFrom(pMsg, glbl.GetLocalHostNameProp());
MsgSetRcvFromIP(pMsg, pLocalHostIP);
+ MsgSetMSGoffs(pMsg, 0);
/* check if we have an error code associated and, if so,
* adjust the tag. -- rgerhards, 2008-06-27
*/
@@ -1079,7 +1084,7 @@ multiSubmitMsg(multi_submit_t *pMultiSub)
* potential for misinterpretation, which we simply can not solve under the
* circumstances given.
*/
-void
+static void
logmsg(msg_t *pMsg, int flags)
{
char *msg;
diff --git a/tools/syslogd.h b/tools/syslogd.h
index 3dfdbe2b..c3b99f9d 100644
--- a/tools/syslogd.h
+++ b/tools/syslogd.h
@@ -32,7 +32,6 @@
/* the following prototypes should go away once we have an input
* module interface -- rgerhards, 2007-12-12
*/
-void logmsg(msg_t *pMsg, int flags);
extern int NoHops;
extern int send_to_all;
extern int Debug;