INN commit: trunk (21 files)

INN Commit rra at isc.org
Sun Nov 8 00:06:54 UTC 2009


    Date: Saturday, November 7, 2009 @ 16:06:54
  Author: iulius
Revision: 8718

* Add a parameter to wire_findheader() so as to keep initial
whitespaces, if needed.  It is USEFOR-compliant (RFC 5536).

* archive, makehistory and tdx-util now generate valid
overview data (with leading spaces).

* Fix a bug in archive which did not change LF (withouth CR)
into spaces when generating overview data.

* Update the test suite.

Modified:
  trunk/backends/archive.c
  trunk/backends/cvtbatch.c
  trunk/backends/innxmit.c
  trunk/expire/makehistory.c
  trunk/frontends/rnews.c
  trunk/frontends/sm.c
  trunk/include/inn/wire.h
  trunk/innd/art.c
  trunk/lib/wire.c
  trunk/nnrpd/article.c
  trunk/nnrpd/newnews.c
  trunk/storage/interface.c
  trunk/storage/ov.c
  trunk/storage/overdata.c
  trunk/storage/overview.c
  trunk/storage/tradspool/tradspool.c
  trunk/tests/data/articles/1
  trunk/tests/data/etc/inn.conf
  trunk/tests/data/overview/1-4
  trunk/tests/data/overview/1-4stripped
  trunk/tests/lib/wire-t.c

---------------------------------+
 backends/archive.c              |   10 ++++------
 backends/cvtbatch.c             |    2 +-
 backends/innxmit.c              |    2 +-
 expire/makehistory.c            |    6 +++---
 frontends/rnews.c               |    2 +-
 frontends/sm.c                  |    6 +++---
 include/inn/wire.h              |   12 +++++-------
 innd/art.c                      |    2 +-
 lib/wire.c                      |    7 +++++--
 nnrpd/article.c                 |    4 ++--
 nnrpd/newnews.c                 |    2 +-
 storage/interface.c             |    2 +-
 storage/ov.c                    |    2 +-
 storage/overdata.c              |    4 ++--
 storage/overview.c              |    2 +-
 storage/tradspool/tradspool.c   |    8 ++++----
 tests/data/articles/1           |    2 ++
 tests/data/etc/inn.conf         |    2 +-
 tests/data/overview/1-4         |    8 ++++----
 tests/data/overview/1-4stripped |    8 ++++----
 tests/lib/wire-t.c              |   24 ++++++++++++------------
 21 files changed, 59 insertions(+), 58 deletions(-)

Modified: backends/archive.c
===================================================================
--- backends/archive.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ backends/archive.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -175,7 +175,7 @@
 {
     const char *start, *end, *p;
 
-    start = wire_findheader(art->data, art->len, header);
+    start = wire_findheader(art->data, art->len, header, false);
     if (start == NULL) {
         fprintf(index, "<none>");
         return;
@@ -186,13 +186,11 @@
         return;
     }
     for (p = start; p <= end; p++) {
-        if (*p == '\r' && p[1] == '\n') {
+        if (*p == '\r' && p < end && p[1] == '\n') {
             p++;
             continue;
         }
-        if (*p == '\n')
-            continue;
-        else if (*p == '\0' || *p == '\t' || *p == '\r')
+        if (*p == '\0' || *p == '\t' || *p == '\r' || *p == '\n')
             putc(' ', index);
         else
             putc(*p, index);
@@ -282,7 +280,7 @@
     /* Determine the groups from the Xref: header.  In groups will be the split
        Xref: header; from the second string on should be a group, a colon, and
        an article number. */
-    start = wire_findheader(art->data, art->len, "Xref");
+    start = wire_findheader(art->data, art->len, "Xref", true);
     if (start == NULL) {
         warn("cannot find Xref: header in %s", token);
         return;

Modified: backends/cvtbatch.c
===================================================================
--- backends/cvtbatch.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ backends/cvtbatch.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -78,7 +78,7 @@
 	token = TextToToken(line);
 	if ((art = SMretrieve(token, RETR_ALL)) == NULL)
 	    continue;
-        text = wire_findheader(art->data, art->len, "Message-ID");
+        text = wire_findheader(art->data, art->len, "Message-ID", true);
 	if (text == NULL) {
 	    SMfreearticle(art);
 	    continue;

Modified: backends/innxmit.c
===================================================================
--- backends/innxmit.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ backends/innxmit.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -681,7 +681,7 @@
     static int	buffsize = 0;
     const char	*p, *q;
 
-    p = wire_findheader(art->data, art->len, "Message-ID");
+    p = wire_findheader(art->data, art->len, "Message-ID", true);
     if (p == NULL)
 	return NULL;
     for (q = p; q < art->data + art->len; q++) {

Modified: expire/makehistory.c
===================================================================
--- expire/makehistory.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ expire/makehistory.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -584,7 +584,7 @@
 	}
     }
     for (fp = ARTfields, i = 0; i < ARTfieldsize; i++, fp++) {
-        fp->Header = wire_findheader(art->data, art->len, fp->Headername);
+        fp->Header = wire_findheader(art->data, art->len, fp->Headername, false);
 
         /* Someone managed to break their server so that they were appending
            multiple Xref headers, and INN had a bug where it wouldn't notice
@@ -600,7 +600,7 @@
                     break;
                 next++;
                 left = art->len - (next - art->data);
-                next = wire_findheader(next, left, fp->Headername);
+                next = wire_findheader(next, left, fp->Headername, false);
                 if (next != NULL)
                     fp->Header = next;
             }
@@ -659,7 +659,7 @@
     }
     if (Missfieldsize > 0) {
 	for (fp = Missfields, i = 0; i < Missfieldsize; i++, fp++) {
-            fp->Header = wire_findheader(art->data, art->len, fp->Headername);
+            fp->Header = wire_findheader(art->data, art->len, fp->Headername, false);
             if (fp->Header != NULL) {
 		fp->HasHeader = true;
                 p = wire_endheader(fp->Header, art->data + art->len - 1);

Modified: frontends/rnews.c
===================================================================
--- frontends/rnews.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ frontends/rnews.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -228,7 +228,7 @@
 
     /* Make sure that all the headers are there, note the ID. */
     for (hp = RequiredHeaders; hp < ARRAY_END(RequiredHeaders); hp++) {
-        p = wire_findheader(wirefmt, length, hp->Name);
+        p = wire_findheader(wirefmt, length, hp->Name, true);
         if (p == NULL) {
             free(wirefmt);
 	    Reject(article, artlen, "bad_article missing %s", hp->Name);

Modified: frontends/sm.c
===================================================================
--- frontends/sm.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ frontends/sm.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -76,7 +76,7 @@
     buffer_free(article);
 
     /* Find the expiration time, if any. */
-    start = wire_findheader(text, size, "Expires");
+    start = wire_findheader(text, size, "Expires", true);
     if (start != NULL) {
         char *expires;
 
@@ -92,7 +92,7 @@
 
     /* Find the appropriate newsgroups header. */
     if (innconf->storeonxref) {
-        start = wire_findheader(text, size, "Xref");
+        start = wire_findheader(text, size, "Xref", true);
         if (start == NULL)
             die("no Xref header found in message");
         end = wire_endheader(start, text + size - 1);
@@ -104,7 +104,7 @@
             die("malformed Xref header");
         start++;
     } else {
-        start = wire_findheader(text, size, "Newsgroups");
+        start = wire_findheader(text, size, "Newsgroups", true);
         if (start == NULL)
             die("no Newsgroups header found in message");
         end = wire_endheader(start, text + size - 1);

Modified: include/inn/wire.h
===================================================================
--- include/inn/wire.h	2009-11-07 21:48:05 UTC (rev 8717)
+++ include/inn/wire.h	2009-11-08 00:06:54 UTC (rev 8718)
@@ -28,14 +28,12 @@
 
 /* Given a pointer to the start of an article and the name of a header, find
    the beginning of the value of the given header (the returned pointer will
-   be after the name of the header and any initial whitespace).  Headers whose
-   only content is whitespace are ignored.  If the header isn't found, returns
-   NULL.
+   be after the name of the header, and also any initial whitespace if specified
+   by the stripspaces argument).  Headers whose only content is whitespace are
+   ignored when whitespaces are stripped.  If the header isn't found, returns
+   NULL. */
+char *wire_findheader(const char *article, size_t, const char *header, bool stripspaces);
 
-   WARNING: This function does not comply with RFC 2822's idea of header
-   content, particularly in its skipping of initial whitespace. */
-char *wire_findheader(const char *article, size_t, const char *header);
-
 /* Given a pointer inside a header's value and a pointer to the end of the
    article, returns a pointer to the end of the header value (the \n at the
    end of the terminating \r\n with folding taken into account), or NULL if no

Modified: innd/art.c
===================================================================
--- innd/art.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ innd/art.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -1154,7 +1154,7 @@
 
   /* Copy Newsgroups: from article be to cancelled to q.
    * Double-terminate q (sentinel). */
-  local = wire_findheader(art->data, art->len, "Newsgroups");
+  local = wire_findheader(art->data, art->len, "Newsgroups", true);
   if (local == NULL) {
     SMfreearticle(art);
     return false;

Modified: lib/wire.c
===================================================================
--- lib/wire.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ lib/wire.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -123,7 +123,8 @@
 **  with content other than spaces and tabs are found, return NULL.
 */
 char *
-wire_findheader(const char *article, size_t length, const char *header)
+wire_findheader(const char *article, size_t length, const char *header,
+                bool stripspaces)
 {
     char *p;
     const char *end;
@@ -141,7 +142,9 @@
         if (p[0] == '\r' && p[1] == '\n')
             return NULL;
         else if (isheader(p, header, headerlen)) {
-            p = skip_fws(p + headerlen + 2, end);
+            p += headerlen + 2;
+            if (stripspaces)
+                p = skip_fws(p, end);
             if (p == NULL)
                 return NULL;
             if (p >= end || p[0] != '\r' || p[1] != '\n')

Modified: nnrpd/article.c
===================================================================
--- nnrpd/article.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ nnrpd/article.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -373,7 +373,7 @@
 
     /* q points to the start of the article buffer, p to the end of it. */
     if (VirtualPathlen > 0 && (what != STbody)) {
-        path = wire_findheader(ARThandle->data, ARThandle->len, "Path");
+        path = wire_findheader(ARThandle->data, ARThandle->len, "Path", true);
         if (path == NULL) {
 	    SendIOv(".\r\n", 3);
 	    ARTgetsize += 3;
@@ -381,7 +381,7 @@
 	    ARTget++;
 	    return;
 	} else {
-            xref = wire_findheader(ARThandle->data, ARThandle->len, "Xref");
+            xref = wire_findheader(ARThandle->data, ARThandle->len, "Xref", true);
             if (xref == NULL) {
                 SendIOv(".\r\n", 3);
                 ARTgetsize += 3;

Modified: nnrpd/newnews.c
===================================================================
--- nnrpd/newnews.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ nnrpd/newnews.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -21,7 +21,7 @@
   const char *p, *p1, *q;
   bool Nocr = true;
 
-  p = wire_findheader(art->data, art->len, hdr);
+  p = wire_findheader(art->data, art->len, hdr, true);
   if (p == NULL)
     return false;
   q = p;

Modified: storage/interface.c
===================================================================
--- storage/interface.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ storage/interface.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -126,7 +126,7 @@
   char	*buff;
   bool	Nocr = false;
 
-  p = wire_findheader(art->data, art->len, "xref");
+  p = wire_findheader(art->data, art->len, "xref", true);
   if (p == NULL)
     return NULL;
   q = p;

Modified: storage/ov.c
===================================================================
--- storage/ov.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ storage/ov.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -259,7 +259,7 @@
     art = SMretrieve(token, RETR_HEAD);
     if (art == NULL)
         return false;
-    xref = wire_findheader(art->data, art->len, "Xref");
+    xref = wire_findheader(art->data, art->len, "Xref", true);
     if (xref == NULL)
         goto fail;
     xrefend = wire_endheader(xref, art->data + art->len - 1);

Modified: storage/overdata.c
===================================================================
--- storage/overdata.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ storage/overdata.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -109,7 +109,7 @@
     size_t offset;
     const char *data, *end, *p;
 
-    data = wire_findheader(article, length, header);
+    data = wire_findheader(article, length, header, false);
     if (data == NULL)
         return;
     end = wire_endheader(data, article + length - 1);
@@ -124,7 +124,7 @@
         const char *next = end + 1;
 
         while (next != NULL) {
-            next = wire_findheader(next, length - (next - article), header);
+            next = wire_findheader(next, length - (next - article), header, false);
             if (next != NULL) {
                 data = next;
                 end = wire_endheader(data, article + length - 1);

Modified: storage/overview.c
===================================================================
--- storage/overview.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ storage/overview.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -248,7 +248,7 @@
     art = SMretrieve(token, RETR_HEAD);
     if (art == NULL)
         return false;
-    xref = wire_findheader(art->data, art->len, "Xref");
+    xref = wire_findheader(art->data, art->len, "Xref", true);
     if (xref == NULL)
         goto fail;
     xrefend = wire_endheader(xref, art->data + art->len - 1);

Modified: storage/tradspool/tradspool.c
===================================================================
--- storage/tradspool/tradspool.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ storage/tradspool/tradspool.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -952,7 +952,7 @@
         return false;
     }
 
-    xrefhdr = wire_findheader(article->data, article->len, "Xref");
+    xrefhdr = wire_findheader(article->data, article->len, "Xref", true);
     if (xrefhdr == NULL) {
 	/* for backwards compatibility; there is no Xref unless crossposted
 	   for 1.4 and 1.5 */
@@ -1139,7 +1139,7 @@
            implications that might have for the callers of SMnext.
 
            Basically, this whole area really needs to be rethought. */
-	xrefhdr = wire_findheader(art->data, art->len, "Xref");
+	xrefhdr = wire_findheader(art->data, art->len, "Xref", true);
 	if (xrefhdr != NULL) {
 	    if ((xrefs = CrackXref(xrefhdr, &numxrefs)) == NULL || numxrefs == 0) {
 		art->len = 0;
@@ -1178,7 +1178,7 @@
 	    }
 	}
 	if (xrefhdr == NULL || !innconf->storeonxref) {
-            ng = wire_findheader(art->data, art->len, "Newsgroups");
+            ng = wire_findheader(art->data, art->len, "Newsgroups", true);
 	    if (ng == NULL) {
 		art->groups = NULL;
 		art->groupslen = 0;
@@ -1188,7 +1188,7 @@
 		art->groupslen = p - ng;
 	    }
 	}
-        expires = wire_findheader(art->data, art->len, "Expires");
+        expires = wire_findheader(art->data, art->len, "Expires", true);
         if (expires == NULL) {
 	    art->expires = 0;
 	} else {

Modified: tests/data/articles/1
===================================================================
--- tests/data/articles/1	2009-11-07 21:48:05 UTC (rev 8717)
+++ tests/data/articles/1	2009-11-08 00:06:54 UTC (rev 8718)
@@ -3,6 +3,8 @@
 Subject: Test article
 From: user at example.com
 Date: Sat, 06 Mar 2004 21:39:44 -0800
+Organization:  Leading space	 tab
+	folded header and trailing space. 
 Message-ID: <example-1 at example.com>
 Xref: news.example.com example.test:1
 

Modified: tests/data/etc/inn.conf
===================================================================
--- tests/data/etc/inn.conf	2009-11-07 21:48:05 UTC (rev 8717)
+++ tests/data/etc/inn.conf	2009-11-08 00:06:54 UTC (rev 8718)
@@ -5,7 +5,7 @@
 mta:                    "/usr/sbin/sendmail -oi -oem %s"
 hismethod:              hisv6
 enableoverview:         false
-extraoverviewhidden:    [ Path ]
+extraoverviewhidden:    [ Path Organization ]
 wireformat:             true
 
 pathnews:               .

Modified: tests/data/overview/1-4
===================================================================
--- tests/data/overview/1-4	2009-11-07 21:48:05 UTC (rev 8717)
+++ tests/data/overview/1-4	2009-11-08 00:06:54 UTC (rev 8718)
@@ -1,4 +1,4 @@
-0 Test article #2	user at example.com	Sat, 06 Mar 2004 21:39:54 -0800	<example-2 at example.com>		294	1	Xref: news.example.com example.config:1	Path: news.example.com!not-for-mail
-0 Test article	user at example.com	Sat, 06 Mar 2004 21:39:44 -0800	<example-1 at example.com>		285	1	Xref: news.example.com example.test:1	Path: news.example.com!not-for-mail
-0 Test article #3 with a | | tab	user at example.com	Sat, 06 Mar 2004 21:40:54 -0800	<example-3 at example.com>		318	1	Xref: news.example.com example.test:2 example.config:2	Path: news.example.com!not-for-mail
-1084956201 This is an aggressively obnoxious article for   testing    overview	I Am User <user at example.com>	Tue, 18 May 2004 01:43:21 -0700	<example-4 at example.com>	<example-1 at example.com> <example-2 at example.com>	504	2	Xref: news.example.com example.test:3	Path: news.example.com!not-for-mail
+0 Test article #2	user at example.com	Sat, 06 Mar 2004 21:39:54 -0800	<example-2 at example.com>		294	1	Xref: news.example.com example.config:1	Path: news.example.com!not-for-mail	
+0 Test article	user at example.com	Sat, 06 Mar 2004 21:39:44 -0800	<example-1 at example.com>		357	1	Xref: news.example.com example.test:1	Path: news.example.com!not-for-mail	Organization:  Leading space  tab folded header and trailing space. 
+0 Test article #3 with a | | tab	user at example.com	Sat, 06 Mar 2004 21:40:54 -0800	<example-3 at example.com>		318	1	Xref: news.example.com example.test:2 example.config:2	Path: news.example.com!not-for-mail	
+1084956201 This is an aggressively obnoxious article for   testing    overview	I Am User <user at example.com>	Tue, 18 May 2004 01:43:21 -0700	<example-4 at example.com>	<example-1 at example.com> <example-2 at example.com>	504	2	Xref: news.example.com example.test:3	Path: news.example.com!not-for-mail	

Modified: tests/data/overview/1-4stripped
===================================================================
--- tests/data/overview/1-4stripped	2009-11-07 21:48:05 UTC (rev 8717)
+++ tests/data/overview/1-4stripped	2009-11-08 00:06:54 UTC (rev 8718)
@@ -1,4 +1,4 @@
-0 Test article #2	user at example.com	Sat, 06 Mar 2004 21:39:54 -0800	<example-2 at example.com>		253	1	Xref: example.config:1	Path: news.example.com!not-for-mail
-0 Test article	user at example.com	Sat, 06 Mar 2004 21:39:44 -0800	<example-1 at example.com>		246	1	Xref: example.test:1	Path: news.example.com!not-for-mail
-0 Test article #3 with a | | tab	user at example.com	Sat, 06 Mar 2004 21:40:54 -0800	<example-3 at example.com>		318	1	Xref: example.test:2 example.config:2	Path: news.example.com!not-for-mail
-1084956201 This is an aggressively obnoxious article for   testing    overview	I Am User <user at example.com>	Tue, 18 May 2004 01:43:21 -0700	<example-4 at example.com>	<example-1 at example.com> <example-2 at example.com>	465	2	Xref: example.test:3	Path: news.example.com!not-for-mail
+0 Test article #2	user at example.com	Sat, 06 Mar 2004 21:39:54 -0800	<example-2 at example.com>		253	1	Xref: example.config:1	Path: news.example.com!not-for-mail	
+0 Test article	user at example.com	Sat, 06 Mar 2004 21:39:44 -0800	<example-1 at example.com>		318	1	Xref: example.test:1	Path: news.example.com!not-for-mail	Organization:  Leading space  tab folded header and trailing space. 
+0 Test article #3 with a | | tab	user at example.com	Sat, 06 Mar 2004 21:40:54 -0800	<example-3 at example.com>		318	1	Xref: example.test:2 example.config:2	Path: news.example.com!not-for-mail	
+1084956201 This is an aggressively obnoxious article for   testing    overview	I Am User <user at example.com>	Tue, 18 May 2004 01:43:21 -0700	<example-4 at example.com>	<example-1 at example.com> <example-2 at example.com>	465	2	Xref: example.test:3	Path: news.example.com!not-for-mail	

Modified: tests/lib/wire-t.c
===================================================================
--- tests/lib/wire-t.c	2009-11-07 21:48:05 UTC (rev 8717)
+++ tests/lib/wire-t.c	2009-11-08 00:06:54 UTC (rev 8718)
@@ -74,38 +74,38 @@
     ok(12, strncmp(p, "Second: Not", strlen("Second: Not")) == 0);
     p = wire_nextline(p, article + st.st_size - 1);
     ok(13, p == NULL);
-    p = wire_findheader(article, st.st_size, "Path");
+    p = wire_findheader(article, st.st_size, "Path", true);
     ok(14, p == article + 6);
-    p = wire_findheader(article, st.st_size, "From");
+    p = wire_findheader(article, st.st_size, "From", true);
     ok(15, strncmp(p, "This is the real", strlen("This is the real")) == 0);
-    p = wire_findheader(article, st.st_size, "SUMMARY");
+    p = wire_findheader(article, st.st_size, "SUMMARY", true);
     ok(16, strncmp(p, "First text", strlen("First text")) == 0);
-    p = wire_findheader(article, st.st_size, "Header");
+    p = wire_findheader(article, st.st_size, "Header", true);
     ok(17, strncmp(p, "This one is real", strlen("This one is real")) == 0);
-    p = wire_findheader(article, st.st_size, "message-id");
+    p = wire_findheader(article, st.st_size, "message-id", true);
     ok(18, strncmp(p, "<foo at example.com>", strlen("<foo at example.com>")) == 0);
-    p = wire_findheader(article, st.st_size, "Second");
+    p = wire_findheader(article, st.st_size, "Second", true);
     ok(19, p == NULL);
-    p = wire_findheader(article, st.st_size, "suBJect");
+    p = wire_findheader(article, st.st_size, "suBJect", true);
     ok(20, strncmp(p, "This is\rnot", strlen("This is\rnot")) == 0);
     end = wire_endheader(p, article + st.st_size - 1);
     ok(21, strncmp(end, "\nFrom: This is", strlen("\nFrom: This is")) == 0);
-    p = wire_findheader(article, st.st_size, "keywordS");
+    p = wire_findheader(article, st.st_size, "keywordS", true);
     ok(22, strncmp(p, "this is --", strlen("this is --")) == 0);
     end = wire_endheader(p, article + st.st_size - 1);
     ok(23, strncmp(end, "\nSummary: ", strlen("\nSummary: ")) == 0);
-    p = wire_findheader(article, st.st_size, "strange");
+    p = wire_findheader(article, st.st_size, "strange", true);
     ok(24, strncmp(p, "This is\n\nnot", strlen("This is\n\nnot")) == 0);
     end = wire_endheader(p, article + st.st_size - 1);
     ok(25, strncmp(end, "\nMessage-ID: ", strlen("\nMessage-ID: ")) == 0);
-    p = wire_findheader(article, st.st_size, "Message");
+    p = wire_findheader(article, st.st_size, "Message", true);
     ok(26, p == NULL);
 
     free(article);
     article = read_file("articles/wire-no-body", &st);
 
     ok(27, wire_findbody(article, st.st_size) == NULL);
-    p = wire_findheader(article, st.st_size, "message-id");
+    p = wire_findheader(article, st.st_size, "message-id", true);
     ok(28, strncmp(p, "<bad-body at example.com>\r\n",
                    strlen("<bad-body at example.com>\r\n")) == 0);
     end = wire_endheader(p, article + st.st_size - 1);
@@ -116,7 +116,7 @@
     article = read_file("articles/wire-truncated", &st);
 
     ok(31, wire_findbody(article, st.st_size) == NULL);
-    p = wire_findheader(article, st.st_size, "date");
+    p = wire_findheader(article, st.st_size, "date", true);
     ok(32, strncmp(p, "Mon, 23 Dec", strlen("Mon, 23 Dec")) == 0);
     ok(33, wire_endheader(p, article + st.st_size - 1) == NULL);
     ok(34, wire_nextline(p, article + st.st_size - 1) == NULL);




More information about the inn-committers mailing list