Re: CARP improvements

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 02 Aug 2011 16:43:59 +1200

On 02/08/11 04:47, Kinkie wrote:
>>> 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.
>

src/cache_cf.cc:
  * you will need to add the '=' to the main strncasecmp to prevent "...
carp-key ..." mistakes and buffer over-reads if its last on the list.

  * s/././ "skip the comma, if a comma is found.ut that"
             "skip the comma, if any"

+1 after those two trivial tweaks.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.14
   Beta testers wanted for 3.2.0.10
Received on Tue Aug 02 2011 - 04:44:06 MDT

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