git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6b69b71
)
Avoid using CLOCK_MONOTONIC for $received_time. Bug 2615
author
Jeremy Harris
<jgh146exb@wizmail.org>
Tue, 31 Aug 2021 20:55:00 +0000
(21:55 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Tue, 31 Aug 2021 21:06:43 +0000
(22:06 +0100)
src/src/receive.c
patch
|
blob
|
history
diff --git
a/src/src/receive.c
b/src/src/receive.c
index 2223d46452fc43184f3f9e36e0c27c6f2e587a78..c2b313c637e5c7be54d6a0e5c25538afba14abbe 100644
(file)
--- a/
src/src/receive.c
+++ b/
src/src/receive.c
@@
-1788,15
+1788,19
@@
if (sender_host_address) dmarc_init(); /* initialize libopendmarc */
/* Remember the time of reception. Exim uses time+pid for uniqueness of message
ids, and fractions of a second are required. See the comments that precede the
/* Remember the time of reception. Exim uses time+pid for uniqueness of message
ids, and fractions of a second are required. See the comments that precede the
-message id creation below. */
+message id creation below.
+We use a routine that if possible uses a monotonic clock, and can be used again
+after reception for the tick-wait even under the Linux non-Posix behaviour. */
exim_gettime(&message_id_tv);
/* For other uses of the received time we can operate with granularity of one
second, and for that we use the global variable received_time. This is for
exim_gettime(&message_id_tv);
/* For other uses of the received time we can operate with granularity of one
second, and for that we use the global variable received_time. This is for
-things like ultimate message timeouts. */
+things like ultimate message timeouts.
+For this we do not care about the Linux suspend/resume problem, so rather than
+use exim_gettime() everywhere we use a plain gettimeofday() here. */
-
received_time = message_id_tv
;
+
gettimeofday(&received_time, NULL)
;
/* If SMTP input, set the special handler for timeouts. The alarm() calls
happen in the smtp_getc() function when it refills its buffer. */
/* If SMTP input, set the special handler for timeouts. The alarm() calls
happen in the smtp_getc() function when it refills its buffer. */
@@
-4326,7
+4330,10
@@
pid can be re-used within our time interval. We can't shorten the interval
without re-designing the message-id. See comments above where the message id is
created. This is Something For The Future.
Do this wait any time we have created a message-id, even if we rejected the
without re-designing the message-id. See comments above where the message id is
created. This is Something For The Future.
Do this wait any time we have created a message-id, even if we rejected the
-message. This gives unique IDs for logging done by ACLs. */
+message. This gives unique IDs for logging done by ACLs.
+The initial timestamp must have been obtained via exim_gettime() to avoid
+issues on Linux with suspend/resume.
+It would be Nicer to only pause before a follow-on message. */
if (id_resolution != 0)
{
if (id_resolution != 0)
{