Re: Generic helper I/O format

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Wed, 04 Jul 2012 17:21:56 -0600

On 07/04/2012 05:07 PM, Amos Jeffries wrote:

> http://wiki.squid-cache.org/Features/AddonHelpers#Negotiate_and_NTLM_Scheme
>
> If you note, the <reason> field is usually something other than OK/ERR,
> so we can parse the old syntax differently to the new OK/ERR responses.
>
> Where there is an overlap (BH) the <reason> field is an error message,
> usually the program name and a ':' colon (not valid in the proposed
> key-name) or number in brackets (again not valid in key name) or plain
> text message (no '=' expected on human-readable words).

You can let setResult() and setKeyValue() methods in HelperReply
children to indicate that what follows is a <blob>:

    NtlmHelperReply::setResult(string result)
    {
        if (result == "BH") {
            ... remember that the result was BH ...
            // no more key=value pairs; read the entire reason
            expectBody(true);
        }
        ...
    }

This is not something you can easily express in a static format spec,
but it will work nicely to avoid custom code when handling "reason
phrases" in BH responses or ssl_crtd certificates. After expectBody() is
called, the general parser will get everything up to the <terminator>
and call setBody().

HTH,

Alex.
Received on Wed Jul 04 2012 - 23:22:05 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 05 2012 - 12:00:03 MDT