[squid-dev] [PATCH] implement RFC3986

Amos Jeffries squid3 at treenet.co.nz
Sat Feb 13 08:47:01 UTC 2016


On 11/02/2016 5:27 a.m., Alex Rousskov wrote:
> On 02/10/2016 08:59 AM, Amos Jeffries wrote:
>> This is the updated patch implementing RFC 3986 URI coding ('URL-escaping').
>>
>> So far all the audit suggestions except Tokenizer usage have been
>> implemented. Tokenizer is omitted because we still want helpers to be
>> able to instantiate these templates functions with std::string.
> 
> I do not think "we" want these templates. If helper code prefers to use
> std::string, that code can call a simple wrapper that converts
> std::string to SBuf or Tokenizer and then calls the non-template Rfc3986
> functions.
> 
> Alex.
> 

For clarity the "we" I was referring to was Kinkie and myself.

The problem it being a template solves is to prevent the helper needing
to be linked against the whole SBuf infrastructure just to convert
to/from SBuf to std::string for its own use.

As I see it there is no benefit from using both in the same code. The
binary either uses SBuf for zero-copy performance benefit or std::string
for slimline portable binary size. Using both just adds the worst parts
of both designs to the final binary behaviour and paying with bloat to
become that.


What is the big problem with these generic template functions?

Amos



More information about the squid-dev mailing list