[PATCH] Helper callback params

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 26 Oct 2012 13:32:09 +1300

Version 5, this includes most of the HelperReply changes brought up earlier.
A few have been held back until a further more complicted parsing including
key=pair upgrade of the helpers API messaging is added in a future patch.

Tested now in production without problems on external_acl, URL-rewrite
and Basic interfaces.

This patch updates the helper reponse callback API from using char*
buffer to a HelperReply object.

* the helper I/O read handler is updated to parse the result code off
the start of the helper response as is currently done for channel-ID.
The callback handlers are altered to use the HelperReply::status instead
of parsing it off themselves individually.

* the remaining I/O read buffer is stored in a MemBuf and callbacks are
updated to use it via the method other().

* the responding helper-server is stored into the HelperReply object and
stateful helper callbacks are combined into the same API as stateless.
The callback handlers are updated to use HelperReply::lastserver instead
of function parameter.

The response format acceptible from any helper is now:
    [channel-ID] [result] [blob] <terminator>

The behavour changes expected from this is that all helpers are now *able*
to send OK/ERR/BH states. Although the handlers for some helpers will
deal with the new states as unknown response. None of the bundled
helpers have been altered to make use of this changed potential.

TODO:
* implement key=value parser for the blob area of the format
* update handlers to use the HelperReply API to retrieve key=pair
* upgrade bundled helpers to use new format

Amos

Received on Fri Oct 26 2012 - 00:32:23 MDT

This archive was generated by hypermail 2.2.0 : Fri Oct 26 2012 - 12:00:08 MDT