summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-16 09:50:46 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-16 09:50:46 +0200
commita4344f350151cdb9172897709fa08680ec8587ba (patch)
treeac847ae140a62397ad5f8e8938e7fc6b6a8f90e1 /runtime
parent73f83d963bc8084a3efc186a383493cbcbc7886e (diff)
parente005c5569c3e0c7c9a098036b7ec3596c3c722b4 (diff)
downloadrsyslog-a4344f350151cdb9172897709fa08680ec8587ba.tar.gz
rsyslog-a4344f350151cdb9172897709fa08680ec8587ba.tar.xz
rsyslog-a4344f350151cdb9172897709fa08680ec8587ba.zip
Merge branch 'master' into newqueue
Conflicts: ChangeLog
Diffstat (limited to 'runtime')
-rw-r--r--runtime/debug.c12
-rw-r--r--runtime/parser.c16
-rw-r--r--runtime/rsyslog.h1
3 files changed, 20 insertions, 9 deletions
diff --git a/runtime/debug.c b/runtime/debug.c
index 959d56a3..476f8bf7 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -960,7 +960,7 @@ void
dbgprintf(char *fmt, ...)
{
va_list ap;
- char pszWriteBuf[1024];
+ char pszWriteBuf[32*1024];
size_t lenWriteBuf;
if(!(Debug && debugging_on))
@@ -969,6 +969,16 @@ dbgprintf(char *fmt, ...)
va_start(ap, fmt);
lenWriteBuf = vsnprintf(pszWriteBuf, sizeof(pszWriteBuf), fmt, ap);
va_end(ap);
+
+ if(lenWriteBuf >= sizeof(pszWriteBuf)) {
+ /* if we need to truncate, do it in a somewhat useful way... */
+ pszWriteBuf[sizeof(pszWriteBuf) - 5] = '!';
+ pszWriteBuf[sizeof(pszWriteBuf) - 4] = '.';
+ pszWriteBuf[sizeof(pszWriteBuf) - 3] = '.';
+ pszWriteBuf[sizeof(pszWriteBuf) - 2] = '.';
+ pszWriteBuf[sizeof(pszWriteBuf) - 1] = '\n';
+ lenWriteBuf = sizeof(pszWriteBuf);
+ }
dbgprint(NULL, pszWriteBuf, lenWriteBuf);
}
diff --git a/runtime/parser.c b/runtime/parser.c
index 466066e7..3c90c447 100644
--- a/runtime/parser.c
+++ b/runtime/parser.c
@@ -231,14 +231,14 @@ sanitizeMessage(msg_t *pMsg)
* can not handle it! -- rgerhards, 2009-08-26
*/
if(pszMsg[iSrc] == '\0' || bEscapeCCOnRcv) {
- /* we are configured to escape control characters. Please note
- * that this most probably break non-western character sets like
- * Japanese, Korean or Chinese. rgerhards, 2007-07-17
- */
- pDst[iDst++] = cCCEscapeChar;
- pDst[iDst++] = '0' + ((pszMsg[iSrc] & 0300) >> 6);
- pDst[iDst++] = '0' + ((pszMsg[iSrc] & 0070) >> 3);
- pDst[iDst++] = '0' + ((pszMsg[iSrc] & 0007));
+ /* we are configured to escape control characters. Please note
+ * that this most probably break non-western character sets like
+ * Japanese, Korean or Chinese. rgerhards, 2007-07-17
+ */
+ pDst[iDst++] = cCCEscapeChar;
+ pDst[iDst++] = '0' + ((pszMsg[iSrc] & 0300) >> 6);
+ pDst[iDst++] = '0' + ((pszMsg[iSrc] & 0070) >> 3);
+ pDst[iDst++] = '0' + ((pszMsg[iSrc] & 0007));
}
} else {
pDst[iDst++] = pszMsg[iSrc];
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index 59e8458b..6cd4df36 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -386,6 +386,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_NO_SRCNAME_TPL = -2150, /**< sourcename template was not specified where one was needed (omudpspoof spoof addr) */
RS_RET_HOST_NOT_SPECIFIED = -2151, /**< (target) host was not specified where it was needed */
RS_RET_ERR_LIBNET_INIT = -2152, /**< error initializing libnet */
+ RS_RET_FORCE_TERM = -2153, /**< thread was forced to terminate be bShallShutdown, a state, not an error */
/* RainerScript error messages (range 1000.. 1999) */
RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */