[squid-dev] [PATCH] Case-insensitive URI schemes

Eduard Bagdasaryan eduard.bagdasaryan at measurement-factory.com
Tue Jan 31 13:18:58 UTC 2017


Optimized with static array as you suggested and
re-attached the patch.


Eduard.


On 30.01.2017 19:24, Alex Rousskov wrote:
> On 01/29/2017 07:10 AM, Amos Jeffries wrote:
>
>> I'm thinking the quick-and-dirty way is to just lowercase the 'proto'
>> variable in url.cc urlParse() function. Doing that in the for-loop where
>> it is copied from 'src' would be easiest.
>>   - it breaks the case preservation on unknown schemes a litte bit. But
>> since they are supposed to be insensitive anyway the harm is minimal.
>
> The UriScheme constructor is broken. No quick-and-dirty fix in some
> constructor caller will address that problem. Eduard's patch fixes that
> problem the right way. Unfortunately, the fixed constructor is
> expensive. Fortunately, it is easy to optimize it, addressing another
> old problem (that the patch has documented but did not address). With
> that optimization, there will be no motivation for quick-and-dirty
> workarounds.
>
> Eduard, please create and use a UriScheme::SchemeImages or similar
> static array with lowercase versions of ProtocolType_str.
>
>
> Thank you,
>
> Alex.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQUID-262-case-insensitive-schemes-t4.patch
Type: text/x-patch
Size: 6536 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20170131/e7e92248/attachment.bin>


More information about the squid-dev mailing list