Re: CARP improvements

From: Kinkie <gkinkie_at_gmail.com>
Date: Mon, 1 Aug 2011 18:47:32 +0200

>> Hi all,
>>   attached is a first revision of the patch for review. I've build-
>> and run- tested it.
>> Only issue not fully investigated is that when an user login is
>> specified in the request, carpSelectParent is not invoked at all. This
>> is however external from the carp code itself; only effect it has is
>> that the "login" carp key selector is actually useless.
>>
>
> When login is in headers rather than URL you may need to use:

As discussed, I'm dropping login as a possible key.

> src/cache_cf.cc:
>  * Can you use strncasecmp instead of casecmp?
>   so the parser can work on const char* and avoid strdup() and \0 writes

Done. Other options would benefit of the same treatment, but it's
outside the scope of this effort.

> src/carp.cc:
>  * s/"cornercases"/"corner cases"

ok

>  * also a bit wrong, this code does not cover _all_ corner cases as
> canonical. Things like unknown method and unknown protocols will use the
> else condition. Which in fact defaults to the custom key.
>  At least the docs needs to say "corner cases should use canonical URL"
>
>  Can you explain why that is even needed though?  Both CONNECT and URN cases
> have all keys with known values. Albeit some values are "".

Done differently. New code blindly tries to use the custom key. If at
the end of the processing it is empty (maybe because the user is
asking to balance on path for a CONNECT request), then urlCanonical is
used. This should automatically cover all corner cases.

New revision is attached.
It also adds support for no-copy config-file parsing, as discussed on IRC.

-- 
    /kinkie

Received on Mon Aug 01 2011 - 17:44:42 MDT

This archive was generated by hypermail 2.2.0 : Tue Aug 02 2011 - 12:00:15 MDT