summaryrefslogtreecommitdiff
path: root/tcps_sess.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcps_sess.c')
-rw-r--r--tcps_sess.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tcps_sess.c b/tcps_sess.c
index 5821e44..4d18b01 100644
--- a/tcps_sess.c
+++ b/tcps_sess.c
@@ -59,8 +59,6 @@ DEFobjCurrIf(netstrm)
DEFobjCurrIf(prop)
DEFobjCurrIf(datetime)
-static int iMaxLine; /* maximum size of a single message */
-
/* forward definitions */
static rsRetVal Close(tcps_sess_t *pThis);
@@ -72,7 +70,7 @@ BEGINobjConstruct(tcps_sess) /* be sure to specify the object type also in END m
pThis->bAtStrtOfFram = 1; /* indicate frame header expected */
pThis->eFraming = TCP_FRAMING_OCTET_STUFFING; /* just make sure... */
/* now allocate the message reception buffer */
- CHKmalloc(pThis->pMsg = (uchar*) MALLOC(sizeof(uchar) * iMaxLine + 1));
+ CHKmalloc(pThis->pMsg = (uchar*) MALLOC(sizeof(uchar) * glbl.GetMaxLine() + 1));
finalize_it:
ENDobjConstruct(tcps_sess)
@@ -253,6 +251,8 @@ defaultDoSubmitMessage(tcps_sess_t *pThis, struct syslogTime *stTime, time_t ttG
CHKiRet(msgConstructWithTime(&pMsg, stTime, ttGenTime));
MsgSetRawMsg(pMsg, (char*)pThis->pMsg, pThis->iMsg);
MsgSetInputName(pMsg, pThis->pLstnInfo->pInputName);
+ if(pThis->pLstnInfo->dfltTZ != NULL)
+ MsgSetDfltTZ(pMsg, (char*) pThis->pLstnInfo->dfltTZ);
MsgSetFlowControlType(pMsg, pThis->pSrv->bUseFlowControl
? eFLOWCTL_LIGHT_DELAY : eFLOWCTL_NO_DELAY);
pMsg->msgFlags = NEEDS_PARSING | PARSE_HOSTNAME;
@@ -307,7 +307,7 @@ PrepareClose(tcps_sess_t *pThis)
* generate an error message and discard the frame.
*/
errmsg.LogError(0, NO_ERRCODE, "Incomplete frame at end of stream in session %p - "
- "ignoring extra data (a message may be lost).\n", pThis->pStrm);
+ "ignoring extra data (a message may be lost).", pThis->pStrm);
/* nothing more to do */
} else { /* here, we have traditional framing. Missing LF at the end
* of message may occur. As such, we process the message in
@@ -356,6 +356,7 @@ processDataRcvd(tcps_sess_t *pThis, char c, struct syslogTime *stTime, time_t tt
{
DEFiRet;
ISOBJ_TYPE_assert(pThis, tcps_sess);
+ int iMaxLine = glbl.GetMaxLine();
if(pThis->inputState == eAtStrtFram) {
if(pThis->bSuppOctetFram && c >= '0' && c <= '9') {
@@ -375,13 +376,13 @@ processDataRcvd(tcps_sess_t *pThis, char c, struct syslogTime *stTime, time_t tt
DBGPRINTF("TCP Message with octet-counter, size %d.\n", pThis->iOctetsRemain);
if(c != ' ') {
errmsg.LogError(0, NO_ERRCODE, "Framing Error in received TCP message: "
- "delimiter is not SP but has ASCII value %d.\n", c);
+ "delimiter is not SP but has ASCII value %d.", c);
}
if(pThis->iOctetsRemain < 1) {
/* TODO: handle the case where the octet count is 0! */
DBGPRINTF("Framing Error: invalid octet count\n");
errmsg.LogError(0, NO_ERRCODE, "Framing Error in received TCP message: "
- "invalid octet count %d.\n", pThis->iOctetsRemain);
+ "invalid octet count %d.", pThis->iOctetsRemain);
} else if(pThis->iOctetsRemain > iMaxLine) {
/* while we can not do anything against it, we can at least log an indication
* that something went wrong) -- rgerhards, 2008-03-14
@@ -389,7 +390,7 @@ processDataRcvd(tcps_sess_t *pThis, char c, struct syslogTime *stTime, time_t tt
DBGPRINTF("truncating message with %d octets - max msg size is %d\n",
pThis->iOctetsRemain, iMaxLine);
errmsg.LogError(0, NO_ERRCODE, "received oversize message: size is %d bytes, "
- "max msg size is %d, truncating...\n", pThis->iOctetsRemain, iMaxLine);
+ "max msg size is %d, truncating...", pThis->iOctetsRemain, iMaxLine);
}
pThis->inputState = eInMsg;
}
@@ -545,7 +546,6 @@ BEGINObjClassInit(tcps_sess, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANGE c
CHKiRet(objUse(prop, CORE_COMPONENT));
CHKiRet(objUse(glbl, CORE_COMPONENT));
- iMaxLine = glbl.GetMaxLine(); /* get maximum size we currently support */
objRelease(glbl, CORE_COMPONENT);
/* set our own handlers */