From 13c32d03f3e640df69327d5127aeeb1e5009e652 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 19 Mar 2008 07:50:47 +0000 Subject: added flow control options to other input sources --- syslogd.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'syslogd.c') diff --git a/syslogd.c b/syslogd.c index 6ecf5865..454083d4 100644 --- a/syslogd.c +++ b/syslogd.c @@ -630,8 +630,12 @@ void untty(void) * printchopped(). rgerhards 2005-10-06 * rgerhards: 2008-03-06: added "flags" to allow an input module to specify * flags, most importantly to request ignoring the messages' timestamp. + * + * rgerhards, 2008-03-19: + * I added an additional calling parameter to permit specifying the flow + * control capability of the source. */ -rsRetVal printline(char *hname, char *msg, int bParseHost, int flags) +rsRetVal printline(char *hname, char *msg, int bParseHost, int flags, flowControl_t flowCtlType) { DEFiRet; register char *p; @@ -641,6 +645,7 @@ rsRetVal printline(char *hname, char *msg, int bParseHost, int flags) /* Now it is time to create the message object (rgerhards) */ CHKiRet(msgConstruct(&pMsg)); + MsgSetFlowControlType(pMsg, flowCtlType); MsgSetRawMsg(pMsg, msg); pMsg->bParseHOSTNAME = bParseHost; @@ -716,9 +721,13 @@ finalize_it: * It also has been adopted to our usual calling interface, but currently does * not provide any useful return states. But we now have the hook and things can * improve in the future. <-- TODO! + * + * rgerhards, 2008-03-19: + * I added an additional calling parameter to permit specifying the flow + * control capability of the source. */ rsRetVal -parseAndSubmitMessage(char *hname, char *msg, int len, int bParseHost, int flags) +parseAndSubmitMessage(char *hname, char *msg, int len, int bParseHost, int flags, flowControl_t flowCtlType) { DEFiRet; register int iMsg; @@ -817,7 +826,7 @@ parseAndSubmitMessage(char *hname, char *msg, int len, int bParseHost, int flags */ if(iMsg == MAXLINE) { *(pMsg + iMsg) = '\0'; /* space *is* reserved for this! */ - printline(hname, tmpline, bParseHost, flags); + printline(hname, tmpline, bParseHost, flags, flowCtlType); } else { /* This case in theory never can happen. If it happens, we have * a logic error. I am checking for it, because if I would not, @@ -869,7 +878,7 @@ parseAndSubmitMessage(char *hname, char *msg, int len, int bParseHost, int flags *(pMsg + iMsg) = '\0'; /* space *is* reserved for this! */ /* typically, we should end up here! */ - printline(hname, tmpline, bParseHost, flags); + printline(hname, tmpline, bParseHost, flags, flowCtlType); finalize_it: RETiRet; -- cgit