]> git.ipfire.org Git - thirdparty/squid.git/commit - src/auth/digest/UserRequest.cc
Support OK/ERR/BH response codes from any helper
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 29 Oct 2012 23:12:04 +0000 (12:12 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 29 Oct 2012 23:12:04 +0000 (12:12 +1300)
commite166785ad679d33acc445d2d96facc065bc63a35
tree7be16d51bd7d2b820a354978f9e2d90043b123e5
parent1564ff62127828f74435650e585f30994cad642d
Support OK/ERR/BH response codes from any helper

Updates the helper reponse callback API from using char* buffer to a
HelperReply object storing teh response code, a blob buffer, and
pointer to the responding helper 'server' (if stateful).

* 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] SP [result] [ [SP] blob] <terminator>

'SP' being one octet \0x20 character.

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 yet 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.
* upgrade helpers to make use of new response format
28 files changed:
src/ClientRequestContext.h
src/HelperReply.cc [new file with mode: 0644]
src/HelperReply.h [new file with mode: 0644]
src/Makefile.am
src/SquidDns.h
src/auth/State.h
src/auth/UserRequest.h
src/auth/basic/UserRequest.cc
src/auth/digest/UserRequest.cc
src/auth/negotiate/UserRequest.cc
src/auth/negotiate/UserRequest.h
src/auth/ntlm/UserRequest.cc
src/auth/ntlm/UserRequest.h
src/client_side.cc
src/client_side.h
src/client_side_request.cc
src/client_side_request.h
src/dns.cc
src/external_acl.cc
src/fqdncache.cc
src/helper.cc
src/helper.h
src/ipcache.cc
src/redirect.cc
src/redirect.h
src/ssl/helper.cc
src/tests/stub_helper.cc
src/typedefs.h