From e0a2745d3f84a2f22ffce029de14e38a6433b402 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 6 May 2008 15:05:39 +0200 Subject: some cleanup (gotten rid of some more plain chars) --- dirty.h | 2 +- doc/features.html | 4 ++-- doc/manual.html | 2 +- plugins/imrelp/imrelp.c | 2 +- plugins/imudp/imudp.c | 2 +- plugins/imuxsock/imuxsock.c | 4 ++-- tcps_sess.c | 2 -- tcps_sess.h | 2 +- tools/syslogd.c | 24 ++++++++++++------------ 9 files changed, 21 insertions(+), 23 deletions(-) diff --git a/dirty.h b/dirty.h index fe188acd..6c451662 100644 --- a/dirty.h +++ b/dirty.h @@ -42,7 +42,7 @@ rsRetVal submitMsg(msg_t *pMsg); rsRetVal logmsgInternal(int pri, uchar *msg, int flags); -rsRetVal parseAndSubmitMessage(char *hname, char *msg, int len, int bParseHost, int flags, flowControl_t flowCtlType); +rsRetVal parseAndSubmitMessage(uchar *hname, uchar *msg, int len, int bParseHost, int flags, flowControl_t flowCtlType); /* TODO: the following 2 need to go in conf obj interface... */ rsRetVal cflineParseTemplateName(uchar** pp, omodStringRequest_t *pOMSR, int iEntry, int iTplOpts, uchar *dfltTplName); diff --git a/doc/features.html b/doc/features.html index 9fbebedf..2b3b31d9 100644 --- a/doc/features.html +++ b/doc/features.html @@ -100,7 +100,7 @@ arithmetic expressions in message filters

World's first

Rsyslog has an interesting number of "world's firsts" - things that were implemented for the first time ever in rsyslog. Some of them are still features not available elsewhere.
@@ -133,4 +133,4 @@ future of RFC 3195 in rsyslog.

To see when each feature was added, see the rsyslog change log (online only).

- \ No newline at end of file + diff --git a/doc/manual.html b/doc/manual.html index 8471a80f..e8a2f929 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -11,7 +11,7 @@ control, high precision timestamps, queued operations and the ability to filter part. It is quite compatible to stock sysklogd and can be used as a drop-in replacement. Its -advanced features make it suitable for enterprise-class, encryption protected syslog +advanced features make it suitable for enterprise-class, encryption protected syslog relay chains while at the same time being very easy to setup for the novice user. And as we know what enterprise users really need, there is also professional diff --git a/plugins/imrelp/imrelp.c b/plugins/imrelp/imrelp.c index 6c969261..3fe030bc 100644 --- a/plugins/imrelp/imrelp.c +++ b/plugins/imrelp/imrelp.c @@ -81,7 +81,7 @@ static relpRetVal onSyslogRcv(uchar *pHostname, uchar __attribute__((unused)) *pIP, uchar *pMsg, size_t lenMsg) { DEFiRet; - parseAndSubmitMessage((char*)pHostname, (char*)pMsg, lenMsg, MSG_PARSE_HOSTNAME, + parseAndSubmitMessage(pHostname, pMsg, lenMsg, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY); RETiRet; diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index e0f9f1d3..5fdb3c91 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -193,7 +193,7 @@ CODESTARTrunInput */ if(net.isAllowedSender(net.pAllowedSenders_UDP, (struct sockaddr *)&frominet, (char*)fromHostFQDN)) { - parseAndSubmitMessage((char*)fromHost, (char*) pRcvBuf, l, + parseAndSubmitMessage(fromHost, pRcvBuf, l, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_NO_DELAY); } else { dbgprintf("%s is not an allowed sender\n", (char*)fromHostFQDN); diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 94f97eb5..4b7cc563 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -176,12 +176,12 @@ static rsRetVal readSocket(int fd, int bParseHost, int flags) { DEFiRet; int iRcvd; - char line[MAXLINE +1]; + uchar line[MAXLINE +1]; iRcvd = recv(fd, line, MAXLINE - 1, 0); dbgprintf("Message from UNIX socket: #%d\n", fd); if (iRcvd > 0) { - parseAndSubmitMessage((char*)glbl.GetLocalHostName(), line, iRcvd, bParseHost, flags, eFLOWCTL_LIGHT_DELAY); + parseAndSubmitMessage(glbl.GetLocalHostName(), line, iRcvd, bParseHost, flags, eFLOWCTL_LIGHT_DELAY); } else if (iRcvd < 0 && errno != EINTR) { char errStr[1024]; rs_strerror_r(errno, errStr, sizeof(errStr)); diff --git a/tcps_sess.c b/tcps_sess.c index cf382db3..0460ebe5 100644 --- a/tcps_sess.c +++ b/tcps_sess.c @@ -335,7 +335,6 @@ static rsRetVal DataRcvd(tcps_sess_t *pThis, char *pData, size_t iLen) { DEFiRet; - char *pMsg; char *pEnd; ISOBJ_TYPE_assert(pThis, tcps_sess); @@ -355,7 +354,6 @@ DataRcvd(tcps_sess_t *pThis, char *pData, size_t iLen) * - printline() the buffer * - continue with copying */ - pMsg = pThis->msg; /* just a shortcut */ pEnd = pData + iLen; /* this is one off, which is intensional */ while(pData < pEnd) { diff --git a/tcps_sess.h b/tcps_sess.h index 9f3d10d6..db52e102 100644 --- a/tcps_sess.h +++ b/tcps_sess.h @@ -42,7 +42,7 @@ typedef struct tcps_sess_s { } inputState; /* our current state */ int iOctetsRemain; /* Number of Octets remaining in message */ TCPFRAMINGMODE eFraming; - char msg[MAXLINE+1]; + uchar msg[MAXLINE+1]; uchar *fromHost; void *pUsr; /* a user-pointer */ } tcps_sess_t; diff --git a/tools/syslogd.c b/tools/syslogd.c index 835a020d..99179e3b 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -598,10 +598,10 @@ void untty(void) * 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, flowControl_t flowCtlType) +rsRetVal printline(uchar *hname, uchar *msg, int bParseHost, int flags, flowControl_t flowCtlType) { DEFiRet; - register char *p; + register uchar *p; int pri; msg_t *pMsg; @@ -609,7 +609,7 @@ rsRetVal printline(char *hname, char *msg, int bParseHost, int flags, flowContro */ CHKiRet(msgConstruct(&pMsg)); MsgSetFlowControlType(pMsg, flowCtlType); - MsgSetRawMsg(pMsg, msg); + MsgSetRawMsg(pMsg, (char*)msg); pMsg->bParseHOSTNAME = bParseHost; /* test for special codes */ @@ -637,15 +637,15 @@ rsRetVal printline(char *hname, char *msg, int bParseHost, int flags, flowContro * being the local host). rgerhards 2004-11-16 */ if(bParseHost == 0) - MsgSetHOSTNAME(pMsg, hname); - MsgSetRcvFrom(pMsg, hname); + MsgSetHOSTNAME(pMsg, (char*)hname); + MsgSetRcvFrom(pMsg, (char*)hname); /* rgerhards 2004-11-19: well, well... we've now seen that we * have the "hostname problem" also with the traditional Unix * message. As we like to emulate it, we need to add the hostname * to it. */ - if(MsgSetUxTradMsg(pMsg, p) != 0) + if(MsgSetUxTradMsg(pMsg, (char*)p) != 0) ABORT_FINALIZE(RS_RET_ERR); logmsg(pMsg, flags); @@ -690,16 +690,16 @@ finalize_it: * control capability of the source. */ rsRetVal -parseAndSubmitMessage(char *hname, char *msg, int len, int bParseHost, int flags, flowControl_t flowCtlType) +parseAndSubmitMessage(uchar *hname, uchar *msg, int len, int bParseHost, int flags, flowControl_t flowCtlType) { DEFiRet; register int iMsg; - char *pMsg; - char *pData; - char *pEnd; - char tmpline[MAXLINE + 1]; + uchar *pMsg; + uchar *pData; + uchar *pEnd; + uchar tmpline[MAXLINE + 1]; # ifdef USE_NETZIP - char deflateBuf[MAXLINE + 1]; + uchar deflateBuf[MAXLINE + 1]; uLongf iLenDefBuf; # endif -- cgit v1.2.3