diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-18 13:22:21 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-18 13:22:21 +0200 |
commit | 8628312396b1535c41124e499d292f4d1e77d955 (patch) | |
tree | d294b3fc3f9adc29b3b9137ce2bff55c21fdee81 /runtime/msg.h | |
parent | f529e8b2c3bb2c087bfba3fc5610a66fdbe1a8ae (diff) | |
download | rsyslog-8628312396b1535c41124e499d292f4d1e77d955.tar.gz rsyslog-8628312396b1535c41124e499d292f4d1e77d955.tar.xz rsyslog-8628312396b1535c41124e499d292f4d1e77d955.zip |
cleaned up/optimized raw message handling in msg object
Diffstat (limited to 'runtime/msg.h')
-rw-r--r-- | runtime/msg.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/msg.h b/runtime/msg.h index 703fdd9f..f2701780 100644 --- a/runtime/msg.h +++ b/runtime/msg.h @@ -28,6 +28,9 @@ #ifndef MSG_H_INCLUDED #define MSG_H_INCLUDED 1 +/* some configuration constants */ +#define CONF_RAWMSG_BUFSIZE 101 + #include <pthread.h> #include "obj.h" #include "syslogd-types.h" @@ -109,6 +112,7 @@ struct msg { int msgFlags; /* flags associated with this message */ ruleset_t *pRuleset; /* ruleset to be used for processing this message */ /* some fixed-size buffers to save malloc()/free() for frequently used fields (from the default templates) */ + uchar szRawMsg[CONF_RAWMSG_BUFSIZE]; /* most messages are small, and these are stored here (without malloc/free!) */ char pszTimestamp3164[16]; char pszTimestamp3339[33]; }; @@ -149,7 +153,8 @@ void MsgAssignHOSTNAME(msg_t *pMsg, char *pBuf); void MsgSetHOSTNAME(msg_t *pMsg, uchar* pszHOSTNAME); rsRetVal MsgSetAfterPRIOffs(msg_t *pMsg, short offs); void MsgSetMSG(msg_t *pMsg, char* pszMSG); -void MsgSetRawMsg(msg_t *pMsg, char* pszRawMsg); +void MsgSetRawMsgWOSize(msg_t *pMsg, char* pszRawMsg); +void MsgSetRawMsg(msg_t *pMsg, char* pszRawMsg, size_t lenMsg); void moveHOSTNAMEtoTAG(msg_t *pM); char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, cstr_t *pCSPropName, unsigned short *pbMustBeFreed); |