INN-current (20090414) and some log messages

Julien ÉLIE julien at trigofacile.com
Tue Apr 28 17:53:22 UTC 2009


Hi Petr,

> Apr 28 15:07:22.535 - ? (null) 439 Bad "Message-ID" header (
> <200904281006.n3S9ohHU003526 at malibu.cc.uga.edu>)
>
> Message-ID:  <200904281006.n3S9ohHU003526 at malibu.cc.uga.edu>

Oh, there's a leading space.

Changed in 2004:
    http://inn.eyrie.org/trac/changeset/6921/trunk/innd/art.c

  On further reflection, undo the change to allow whitespace around message
  IDs, since right now the whitespace may be included in the hash.  This is
  the right idea, but we're going to have to put more intelligence in the
  parsing to extract just the message ID.


I believe the following patch does the trick (at least, it works for me
-- the message-ID is correctly parsed and CHECK shows the hash is right):

Index: innd/art.c
===================================================================
--- innd/art.c  (révision 8434)
+++ innd/art.c  (copie de travail)
@@ -680,12 +680,23 @@
     cp->Data.BytesHeader = header;
   hc = &hc[i];
   if (hc->Length != 0) {
-    /* duplicated */
+    /* Duplicated. */
     hc->Length = -1;
   } else {
-    hc->Value = colon + 2;
-    /* HDR_LEN() does not include trailing "\r\n" */
-    hc->Length = size - (hc->Value - header) - 2;
+    /* We need to remove leading and trailing spaces for
+     * message-IDs; otherwise, ARTidok() will fail. */
+    if (i == HDR__MESSAGE_ID || i == HDR__SUPERSEDES) {
+      for (p = colon + 1 ; (p < header + size - 2) &&
+           (ISWHITE(*p)) ; p++);
+      hc->Value = p;
+      for (p = header + size - 3 ; (p > hc->Value) &&
+           (ISWHITE(*p)) ; p--);
+      hc->Length = p - hc->Value + 1;
+    } else {
+      hc->Value = colon + 2;
+      /* HDR_LEN() does not include trailing "\r\n". */
+      hc->Length = size - (hc->Value - header) - 2;
+    }
   }
   return;
 }


Does it sound the right thing to do, Russ, or is there something
I am missing as for hashes and extraction?

-- 
Julien ÉLIE

« Constitutiones tempore posteriores potiores prioribus. » 




More information about the inn-workers mailing list