summaryrefslogtreecommitdiffstats
path: root/plugins/omrelp
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/omrelp
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/omrelp')
-rw-r--r--plugins/omrelp/omrelp.c6
1 files changed, 4 insertions, 2 deletions
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