INN-current (20090414) and some log messages

Russ Allbery rra at stanford.edu
Tue Apr 28 18:44:27 UTC 2009


Julien ÉLIE <julien at trigofacile.com> writes:

> 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?

That looks right to me.  I think I mostly just hadn't done the necessary
work to figure out the best place to make that change and the right
logic for it.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.



More information about the inn-workers mailing list