[PATCH] Helper callback params

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 05 Jul 2012 18:31:23 +1200

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.

After this patch the helper response format is: [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, and update
handlers to use the HelperReply API to retrieve them.

Amos

Received on Thu Jul 05 2012 - 06:31:34 MDT

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