summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-10-07 14:26:41 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-10-07 14:26:41 +0200
commit8528344ef58b5d2907bba8809f63d0bca2ce8d38 (patch)
treea7246f6453782404f2a197ea0b96c87c6d20a03b /action.c
parentcdecd7e524a5114ccff4f2909b32738bdb33c6ea (diff)
downloadrsyslog-8528344ef58b5d2907bba8809f63d0bca2ce8d38.tar.gz
rsyslog-8528344ef58b5d2907bba8809f63d0bca2ce8d38.tar.xz
rsyslog-8528344ef58b5d2907bba8809f63d0bca2ce8d38.zip
"output" timestamp now taken from mesg's time generated
This enhances performance and, as some have pointed out, is probably also more consistent with what users expect how the various output-timestamp related function should work. This commit needs some more testing.
Diffstat (limited to 'action.c')
-rw-r--r--action.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/action.c b/action.c
index a25eca23..cc62f028 100644
--- a/action.c
+++ b/action.c
@@ -602,7 +602,7 @@ actionWriteToAction(action_t *pAction)
* ... RAWMSG is a problem ... Please note that digital
* signatures inside the message are also invalidated.
*/
- datetime.getCurrTime(&(pMsg->tRcvdAt));
+ datetime.getCurrTime(&(pMsg->tRcvdAt), &(pMsg->ttGenTime));
memcpy(&pMsg->tTIMESTAMP, &pMsg->tRcvdAt, sizeof(struct syslogTime));
MsgSetMSG(pMsg, (char*)szRepMsg);
MsgSetRawMsg(pMsg, (char*)szRepMsg);
@@ -640,6 +640,7 @@ actionWriteToAction(action_t *pAction)
* while in the on-disk queue. Also need to think about a few other implications.
* rgerhards, 2008-09-17
*/
+#if 0
{
struct tm tTm;
tTm.tm_sec = pAction->f_pMsg->tRcvdAt.second;
@@ -655,7 +656,10 @@ actionWriteToAction(action_t *pAction)
/* note: mktime seems to do a stat(/etc/localtime), so this is also sub-optimal! */
dbgprintf("XXXX create our own timestamp: %ld, system time is %ld\n", pAction->f_time, time(NULL));
}
+#endif
+ pAction->f_time = pAction->f_pMsg->ttGenTime;
+dbgprintf("XXXX create our own timestamp: %ld, system time is %ld\n", pAction->f_time, time(NULL));
//pAction->f_time = getActNow(pAction); /* re-init time flags */
/* Note: tLastExec could be set in the if block above, but f_time causes us a hard time
* so far, I do not see a solution to getting rid of it. -- rgerhards, 2008-09-16