bug fix for OVfindheaderindex in storage/ov.c
Richard Todd
rmtodd at skywalker.ecn.ou.edu
Tue Feb 1 06:51:39 UTC 2000
In OVfindheaderindex() in ov.c, the function is supposed to find the
locations of the Xref, Message-Id, and Date headers in the overview format
description. Unfortunately, spurious breaks in the loop cause the loop
to bail after finding Date before it ever gets to set Xrefindex and
Messageidindex. This leads to Xrefindex still being OVFMT_UNINIT (-2)
when OVgroupbasedexpire gets called, leading to much confusion as
OVERgetheader(data, Xrefindex) returns garbage upon trying to find the -2th
field of the overview line. expireover thus thinks that all existing
overview entries are corrupt and drops them.
While I was there, I went ahead and adjusted some confusing indentation
a few lines up in that function.
Index: storage/ov.c
===================================================================
RCS file: /home/rmtodd/TempCVS/Temp-CVS-Repository/inn-current/storage/ov.c,v
retrieving revision 1.1.1.8
diff -u -r1.1.1.8 ov.c
--- ov.c 2000/01/29 05:31:49 1.1.1.8
+++ ov.c 2000/02/01 06:36:21
@@ -990,7 +990,7 @@
int i;
if (ReadOverviewfmt)
- return;
+ return;
ACTIVE = COPY(cpcatpath(innconf->pathdb, _PATH_ACTIVE));
if ((active = ReadInFile(ACTIVE, (struct stat *)NULL)) == NULL) {
(void)fprintf(stderr, "Can't read %s, %s\n",
@@ -1010,13 +1010,10 @@
for (Dateindex = OVFMT_NODATE, i = 0; i < ARTfieldsize; i++) {
if (caseEQ(ARTfields[i].Header, "Date")) {
Dateindex = i;
- break;
} else if (caseEQ(ARTfields[i].Header, "Xref")) {
Xrefindex = i;
- break;
} else if (caseEQ(ARTfields[i].Header, "Message-ID")) {
Messageidindex = i;
- break;
}
}
}
More information about the inn-patches
mailing list