Hi Malcolm,

On Wed, May 09, 2012 at 03:51:46PM -0700, Malcolm Handley wrote:
> Cook_val sounds great if you happen to add that.

I've added this for you in dev9 :-)

> How long do snapshots
> take to become the stable version, generally?

There generally are a few months between dev releases. And dev
releases are *not* stable versions. It only happens that I try
to get them stable enough for enthousiasts to use them carefully
and provide useful feedback. For instance, Cyril found a few
important bugs, so I'll have to emit a dev10 soon with them fixed.

If you want something really stable, you should use 1.4, not 1.5-dev.

> We've had some outages
> (nothing to do with haproxy, which works great) and definitely don't
> want to put bleeding-edge code into production at the moment.

I certainly understand. The best to do after a dev release is to wait
1 or 2 weeks for bug reports, and either you pick the fixes from next
snapshots or you wait for a new dev release.

> > In the mean time, I think that if you manage to rewrite your cookie header
> > to replace it with a header holding only the value, it might work, though
> > it's dirty and quite tricky.
> 
> This is a great suggestion. Can you confirm that header rewriting
> happens before other calls to hdr_val? (Do the commands happen in
> order?)

I'm not certain about this, I'd have to recheck the code for this.

> (One thing that's great about this is it would also let me
> avoid creating a new header. My goal is to write an ACL of the form
> [block if cook_value(user_id) % 1000 < 250] but ACLs don't support
> much math. But your suggestion would get around this.)

OK.

> > Instead, with regex you can actually match integer expressions, it's just
> > a bit complicated but doable. For instance, a value below 25 might be
> > defined like this (not tested right now but you get the idea) :
> >
> >      COOK=([0-9]|1[0-9]|2[0-4])([^0-9]|$)
> >
> > I've been doing this for a long time to extract requests by response times
> > in logs until I got fed up and wrote halog.
> 
> Yeah. I thought of this too. I know that I could do it but we are
> creating a tool to use in emergencies and I think that I'd be
> frightened of messing it up in some small but important way. :-)

I can understand! However the regex will provide you the modulo 1000 for
free :-)

Willy


Reply via email to