INN commit: branches/2.5 (expire/makehistory.c innd/art.c)
INN Commit
rra at isc.org
Sun Sep 26 11:37:05 UTC 2010
Date: Sunday, September 26, 2010 @ 04:37:05
Author: iulius
Revision: 9120
Go on checking the syntax of the Date: header field, even though
it is not used by innd when an Injection-Date: header field
exists.
Modified:
branches/2.5/expire/makehistory.c
branches/2.5/innd/art.c
----------------------+
expire/makehistory.c | 2 ++
innd/art.c | 26 +++++++++++++-------------
2 files changed, 15 insertions(+), 13 deletions(-)
Modified: expire/makehistory.c
===================================================================
--- expire/makehistory.c 2010-09-26 11:36:27 UTC (rev 9119)
+++ expire/makehistory.c 2010-09-26 11:37:05 UTC (rev 9120)
@@ -747,6 +747,8 @@
buffer_set(&buffer, InjectionDatep->Header, InjectionDatep->HeaderLength);
buffer_append(&buffer, NUL, 1);
Posted = parsedate_rfc5322_lax(buffer.data);
+ /* If parsing failed for Injection-Date:, take the arrival time.
+ * Do not look at the Date: header (though we could). */
if (Posted == (time_t) -1)
Posted = Arrived;
} else {
Modified: innd/art.c
===================================================================
--- innd/art.c 2010-09-26 11:36:27 UTC (rev 9119)
+++ innd/art.c 2010-09-26 11:37:05 UTC (rev 9120)
@@ -1043,8 +1043,19 @@
/* Is the article too old? */
/* Assumes the Date: header is a required header.
- * Check the presence of the Injection-Date: header field before.
- * Set the time the article was posted. */
+ * Check the presence of the Injection-Date: header field, which will
+ * override the value of the time the article was posted. */
+ p = HDR(HDR__DATE);
+ data->Posted = parsedate_rfc5322_lax(p);
+
+ if (data->Posted == (time_t) -1) {
+ sprintf(buff, "%d Bad \"Date\" header -- \"%s\"",
+ ihave ? NNTP_FAIL_IHAVE_REJECT : NNTP_FAIL_TAKETHIS_REJECT,
+ MaxLength(p, p));
+ TMRstop(TMR_ARTCLEAN);
+ return false;
+ }
+
if (HDR_FOUND(HDR__INJECTION_DATE)) {
p = HDR(HDR__INJECTION_DATE);
data->Posted = parsedate_rfc5322_lax(p);
@@ -1056,17 +1067,6 @@
TMRstop(TMR_ARTCLEAN);
return false;
}
- } else {
- p = HDR(HDR__DATE);
- data->Posted = parsedate_rfc5322_lax(p);
-
- if (data->Posted == (time_t) -1) {
- sprintf(buff, "%d Bad \"Date\" header -- \"%s\"",
- ihave ? NNTP_FAIL_IHAVE_REJECT : NNTP_FAIL_TAKETHIS_REJECT,
- MaxLength(p, p));
- TMRstop(TMR_ARTCLEAN);
- return false;
- }
}
if (innconf->artcutoff != 0) {
More information about the inn-committers
mailing list