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 /plugins/omgssapi | |
parent | c2f30a2fc3fb1f87c157828dd08ee20fe444833d (diff) | |
download | rsyslog-1a9ac0ced72dd163228438af4f31f233fab20529.tar.gz rsyslog-1a9ac0ced72dd163228438af4f31f233fab20529.tar.xz 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 'plugins/omgssapi')
-rw-r--r-- | plugins/omgssapi/omgssapi.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/omgssapi/omgssapi.c b/plugins/omgssapi/omgssapi.c index 82fca2db..e0cc8af6 100644 --- a/plugins/omgssapi/omgssapi.c +++ b/plugins/omgssapi/omgssapi.c @@ -378,6 +378,7 @@ ENDtryResume BEGINdoAction char *psz; /* temporary buffering */ register unsigned l; + int iMaxLine; CODESTARTdoAction switch (pData->eDestState) { case eDestFORW_SUSP: @@ -392,10 +393,11 @@ CODESTARTdoAction case eDestFORW: dbgprintf(" %s:%s/%s\n", pData->f_hname, getFwdSyslogPt(pData), "tcp-gssapi"); + iMaxLine = glbl.GetMaxLine(); 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 +409,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", @@ -442,6 +448,7 @@ CODESTARTdoAction } break; } +finalize_it: ENDdoAction |