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

Alex Rousskov rousskov at measurement-factory.com
Mon Jan 30 16:24:34 UTC 2017


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.



More information about the squid-dev mailing list