Re: [PATCH] Unknown cfg function

From: Tsantilas Christos <chtsanti_at_users.sourceforge.net>
Date: Tue, 30 Jul 2013 21:47:53 +0300

On 07/30/2013 09:17 PM, Amos Jeffries wrote:
>> However Amos refers to an other case. For the following line:
>> "Simple Tokens"
>> we may want to retrieve the token "Simple
>>
>> Do we have any example where this is required? (Not for regex, for regex
>> we have an exception...)
>
> In most places where we accept header values in the legacy parser.

Well the request_header_add already understand quoted strings.

The parse_http_header_replace should use the
ConfigParser::NextQuotedOrToEol.
I just show that there is a problem here. It will work as is. But the
code is not correct....

The other functions hae only header names...

>
> I have seen a few people who have things like "quoted string" for auth
> realm, and since the old squid.conf sent the quotes out as-is they ended
> up with helpers and browsers security records using the quoted form.
> There might be any amount of unknown pain ahead if we suddenly start
> stripping quotes off strings in the backward compatible parse mode.

The realm uses the parse_eol which uses the
ConfigParser::NextQuotedOrToEol method which handles such cases....

>
>
>>
>>>
>>>>> For the new style if someone want to use '(' character on a regex for
>>>>> example, he should use quotes:
>>>>> 'test(.*/)'
>>>>> "test(.*/)"
>>> Double quotes do not work well because REs use backslashes of their own.
>>> It becomes too messy as Amos noted above. I think we should not support
>>> REs in a new parser until we add Perl-like RE quoting (or better).
>> OK. This is something we can do it.
>> We can add a method ConfigParser::NextWord which will return a raw word
>> which will consist by any non whitespace character. Whitespaces can be
>> escaped.
>> Or use an On/Off global variable which enables/disables for the next
>> token this behaviour....
>
> Hmm. Might work.
>
> I have in mind to shuffle the ConfigParser methods into groups. One for
> the parser mechanics and one group for the type-specific GetX() methods.
> Some of those methods are provided in ConfigParser already, the rest are
> mixed up with src/Parsing.cc.
>
> A ConfigParser::RegexPattern() method should be perfectly fine to add.
>

This is looks good.

>
> Amos
>
Received on Tue Jul 30 2013 - 18:48:07 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 31 2013 - 12:00:07 MDT