summaryrefslogtreecommitdiffstats
path: root/plugins/imudp
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-18 13:22:21 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-18 13:22:21 +0200
commit8628312396b1535c41124e499d292f4d1e77d955 (patch)
treed294b3fc3f9adc29b3b9137ce2bff55c21fdee81 /plugins/imudp
parentf529e8b2c3bb2c087bfba3fc5610a66fdbe1a8ae (diff)
downloadrsyslog-8628312396b1535c41124e499d292f4d1e77d955.tar.gz
rsyslog-8628312396b1535c41124e499d292f4d1e77d955.tar.xz
rsyslog-8628312396b1535c41124e499d292f4d1e77d955.zip
cleaned up/optimized raw message handling in msg object
Diffstat (limited to 'plugins/imudp')
-rw-r--r--plugins/imudp/imudp.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c
index 97e66e8e..2340aac4 100644
--- a/plugins/imudp/imudp.c
+++ b/plugins/imudp/imudp.c
@@ -241,10 +241,7 @@ processSocket(int fd, struct sockaddr_storage *frominetPrev, int *pbIsPermitted,
}
/* we now create our own message object and submit it to the queue */
CHKiRet(msgConstructWithTime(&pMsg, &stTime, ttGenTime));
- /* first trim the buffer to what we have actually received */
- CHKmalloc(pMsg->pszRawMsg = malloc(sizeof(uchar)* lenRcvBuf));
- memcpy(pMsg->pszRawMsg, pRcvBuf, lenRcvBuf);
- pMsg->iLenRawMsg = lenRcvBuf;
+ MsgSetRawMsg(pMsg, (char*)pRcvBuf, lenRcvBuf);
MsgSetInputName(pMsg, UCHAR_CONSTANT("imudp"), sizeof("imudp")-1);
MsgSetFlowControlType(pMsg, eFLOWCTL_NO_DELAY);
pMsg->msgFlags = NEEDS_PARSING | PARSE_HOSTNAME;