[squid-dev] [PATCH] implement RFC3986

Alex Rousskov rousskov at measurement-factory.com
Mon Feb 8 15:55:40 UTC 2016


On 02/07/2016 10:02 PM, Amos Jeffries wrote:

> The desired for-loop cannot be used apparently because SBuf lacks a
> const_iterator definition. That will need to happen before we can apply
> this, or put up with several very nasty const_cast.

If some code needs it, we should add SBuf::const_iterator.


>>>> +public:
>>>> +    const static CharacterSet
>>>> +        Unsafe,  // RFC 1738 unsafe set
>>>> +        Ctrls,   // control characters (\0x00 to \0x1f)
>>>> +        UnsafeAndCtrls, // RFC 1738 Unsafe and Ctrls
>>>> +        Reserved1738, // RFC 1738 Reserved set
>>>> +        GenDelims,// RFC 3986 gen-delims set
>>>> +        SubDelims,// RFC 3986 sub-delims set
>>>> +        Reserved, // RFC 3986 reserved characters set
>>>> +        Unreserved, // RFC 3986 unreserved characters set
>>>> +        Unescaped,//ctrls and unsafe except for percent symbol
>>>> +        All;
>>>> +
>>>> +};
>>>
>>> This is not a class but a namespace.
>>>
>>> Please s/RFC3986/Rfc3986/ for consistency with similar "let's group RFC
>>> concepts in one namespace" SslBump code posted by Christos earlier (IIRC).


> I was not able to find that posting yet. 

Look for "namespace Rfc5246" in the PREVIEW patch archived at

http://lists.squid-cache.org/pipermail/squid-dev/2015-December/004297.html


FWIW, we are considering removing that namespace for the reasons
discussed in the namespace description comment:

> +// TODO: Consider removing this namespace. The idea was to encapsulate various
> +// RFC 5246 types defined using the naming scheme from the RFC rather than
> +// following Squid naming conventions. However, using these names in other code
> +// may make that code inconsistent. Besides, we are running into some C++ naming
> +// limits.

Nevertheless, my recommendation regarding CamelCase naming for RFC-based
namespaces stands.

The problems mentioned in the patch comment quoted above are not related
to RFC 3986 and RFC 1738 code that you are dealing with. RFC 5246 has
code snippets that we were trying to emulate, but doing so resulted in
inconsistent code style, so that experiment probably failed.


HTH,

Alex.



More information about the squid-dev mailing list