summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-14 17:03:14 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-14 17:03:14 +0000
commitb0e8ce6c3d48e664135a0f74d5b4df2b3a42827f (patch)
treeb564ab5c477c194de8985d9c97a048b7fb95629c /plugins
parent38362e127f7b7b836332bf17097dbbae71bbe810 (diff)
downloadrsyslog-b0e8ce6c3d48e664135a0f74d5b4df2b3a42827f.tar.gz
rsyslog-b0e8ce6c3d48e664135a0f74d5b4df2b3a42827f.tar.xz
rsyslog-b0e8ce6c3d48e664135a0f74d5b4df2b3a42827f.zip
bugfix: TCP (and GSSAPI) octet-counted frame did not work correctly in all
situations. If the header was split across two packet reads, it was invalidly processed, causing loss or modification of messages.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imgssapi/imgssapi.c2
-rw-r--r--plugins/omrelp/omrelp.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/plugins/imgssapi/imgssapi.c b/plugins/imgssapi/imgssapi.c
index 8d406a7e..74d5d5c5 100644
--- a/plugins/imgssapi/imgssapi.c
+++ b/plugins/imgssapi/imgssapi.c
@@ -480,7 +480,7 @@ OnSessAcceptGSS(tcpsrv_t *pThis, tcps_sess_t *pSess)
(GSS_ROUTINE_ERROR(maj_stat) == GSS_S_DEFECTIVE_TOKEN)) {
dbgprintf("GSS-API Reverting to plain TCP\n");
dbgprintf("tcp session socket with new data: #%d\n", fdSess);
- if(tcps_sess.DataRcvd(pSess, buf, ret) == 0) {
+ if(tcps_sess.DataRcvd(pSess, buf, ret) != RS_RET_OK) {
errmsg.LogError(NO_ERRCODE, "Tearing down TCP Session %p - see "
"previous messages for reason(s)\n", pSess);
ABORT_FINALIZE(RS_RET_ERR); // TODO: define good error codes
diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c
index 22482c23..9dd75a84 100644
--- a/plugins/omrelp/omrelp.c
+++ b/plugins/omrelp/omrelp.c
@@ -152,6 +152,8 @@ static rsRetVal TCPSendFrame(void *pvData, char *msg, size_t len)
lenSend = send(pData->sock, msg, len, 0);
dbgprintf("TCP sent %ld bytes, requested %ld\n", (long) lenSend, (long) len);
+if(lenSend > 2000)
+ dbgprintf("TCP (msgoverflow) sent %ld bytes, requested %ld\n", (long) lenSend, (long) len);
if(lenSend == -1) {
/* we have an error case - check what we can live with */
@@ -500,10 +502,10 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
CHKiRet(tcpclt.SetSendInit(pData->pTCPClt, TCPSendInit));
CHKiRet(tcpclt.SetSendFrame(pData->pTCPClt, TCPSendFrame));
CHKiRet(tcpclt.SetSendPrepRetry(pData->pTCPClt, TCPSendPrepRetry));
- CHKiRet(tcpclt.SetFraming(pData->pTCPClt, tcp_framing));
+ CHKiRet(tcpclt.SetFraming(pData->pTCPClt, TCP_FRAMING_OCTET_COUNTING));
/* TODO: do we need to call freeInstance if we failed - this is a general question for
- * all output modules. I'll address it lates as the interface evolves. rgerhards, 2007-07-25
+ * all output modules. I'll address it later as the interface evolves. rgerhards, 2007-07-25
*/
CODE_STD_FINALIZERparseSelectorAct
ENDparseSelectorAct