PATCH: diablo style hashfeeds

Julien ÉLIE julien at trigofacile.com
Mon Mar 24 09:16:22 UTC 2008


Hi Miquel,

Thanks for this revised version.  I have just committed it.

Below are some comments:

> +The hashfeed match expression for this site. It must be in the form
> +C<value/mod> or C<start-end/mod>. The message-id of the article is
> +hashed using MD5, which results in a 128 bit hash. The lowest 32 bits
> +(by default) are then taken as the C<hashfeed value>. If the hashfeed
> +value modulus C<mod> plus one equals C<number> or is between C<start>
                                          ^^^^^^
> +and C<end>, the article will be fed to the site.

C<value>.


> +Only four totally independent
> +values exist: C<_0>, C<_4>, C<_8> and C<_12>.

"Only *up to* four" to be accurate (I missed that point when writing this
paragraph).


> + if (sscanf(p, "%u-%u/%u", &hf->begin, &hf->end, &hf->mod) != 3) {
> +   if (sscanf(p, "%u/%u", &hf->begin, &hf->mod) == 2) {
> +     hf->end = hf->begin;
> +   } else {
> +     free(hf);
> +     return "hash not in x/z or x-y/z format for Q";
> +   }
> +   if (hf->begin > hf->end || hf->end > hf->mod) {
> +     free(hf);
> +     return "incorrect hash values for Q";
> +   }
> + }

It should be closed sooner (before the check of correct hash values).

    if (sscanf(p, "%u/%u", &hf->begin, &hf->mod) == 2) {
      hf->end = hf->begin;
    } else if (sscanf(p, "%u-%u/%u", &hf->begin, &hf->end,
                      &hf->mod) != 3) {
      free(hf);
      return "hash not in x/z or x-y/z format for Q param in field 3";
    }
    if (hf->begin > hf->end || hf->end > hf->mod) {
      free(hf);
      return "incorrect hash values for Q param in field 3";
    }


> +    'Q', '^@?\d(-\d)?/\d(:\d)?$',

Here is a better regexp pattern:

       'Q', '^@?\d+(-\d+)?/\d+(_\d+)?$',


Thanks again for all your work.

Have a nice Easter Monday,

-- 
Julien ÉLIE

« Quae longo tempore extenuentur corpora,
  lente reficere oportet. » (Hippocrate)



More information about the inn-workers mailing list