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

Eduard Bagdasaryan eduard.bagdasaryan at measurement-factory.com
Wed Feb 1 14:45:35 UTC 2017

This is a bit improved version of previous patch:
fill static schemes array at configuration phase.


On 31.01.2017 16:18, Eduard Bagdasaryan wrote:
> 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-t5.patch
Type: text/x-patch
Size: 10878 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20170201/e6ab52f0/attachment-0001.bin>

More information about the squid-dev mailing list