diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-09-02 11:38:31 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-09-02 11:38:31 +0200 |
commit | 1a9ac0ced72dd163228438af4f31f233fab20529 (patch) | |
tree | 6f228f58615d596bef9ca4f3f0da934368191369 /tools/omfwd.c | |
parent | c2f30a2fc3fb1f87c157828dd08ee20fe444833d (diff) | |
download | rsyslog-1a9ac0ced72dd163228438af4f31f233fab20529.tar.gz rsyslog-1a9ac0ced72dd163228438af4f31f233fab20529.tar.bz2 rsyslog-1a9ac0ced72dd163228438af4f31f233fab20529.zip |
removed compile time fixed message size limit (was 2K)
The limit can now be set via $MaxMessageSize global config
directive (finally gotten rid of MAXLINE ;))
Diffstat (limited to 'tools/omfwd.c')
-rw-r--r-- | tools/omfwd.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/omfwd.c b/tools/omfwd.c index df2f0342..1dd184ef 100644 --- a/tools/omfwd.c +++ b/tools/omfwd.c @@ -386,16 +386,19 @@ ENDtryResume BEGINdoAction char *psz; /* temporary buffering */ register unsigned l; + int iMaxLine; CODESTARTdoAction CHKiRet(doTryResume(pData)); + iMaxLine = glbl.GetMaxLine(); + dbgprintf(" %s:%s/%s\n", pData->f_hname, getFwdPt(pData), pData->protocol == FORW_UDP ? "udp" : "tcp"); psz = (char*) ppString[0]; l = strlen((char*) psz); - if (l > MAXLINE) - l = MAXLINE; + if((int) l > iMaxLine) + l = iMaxLine; # ifdef USE_NETZIP /* Check if we should compress and, if so, do it. We also @@ -407,10 +410,14 @@ CODESTARTdoAction * rgerhards, 2006-11-30 */ if(pData->compressionLevel && (l > MIN_SIZE_FOR_COMPRESS)) { - Bytef out[MAXLINE+MAXLINE/100+12] = "z"; + Bytef *out; uLongf destLen = sizeof(out) / sizeof(Bytef); uLong srcLen = l; int ret; + /* TODO: optimize malloc sequence? -- rgerhards, 2008-09-02 */ + CHKmalloc(out = (Bytef*) malloc(iMaxLine + iMaxLine/100 + 12)); + out[0] = 'z'; + out[1] = '\0'; ret = compress2((Bytef*) out+1, &destLen, (Bytef*) psz, srcLen, pData->compressionLevel); dbgprintf("Compressing message, length was %d now %d, return state %d.\n", |