lp://qastaging/~yadi/squid/helpers

Created by Amos Jeffries and last modified

Branch for testing helper updates.

Get this branch:
bzr branch lp://qastaging/~yadi/squid/helpers
Only Amos Jeffries can upload to this branch. If you are Amos Jeffries please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Amos Jeffries
Project:
Squid
Status:
Development

Recent revisions

12355. By Amos Jeffries

Merge from trunk

12354. By Amos Jeffries

Merged from trunk

12353. By Amos Jeffries

Fix bug reading second helper reply line.

Buffer management in helper reply handling was leaving one \0 octet in
the buffer to corrupt the followup responses. This change moves all
helper reply buffer calculations and shifting to the read handler and
out of the reply handler, which is left managing just the buffer
sub-string where the reply data exists.

Also, remove an obsolete TODO.

12352. By Amos Jeffries

Docs: doxygenate the HttpRequest::helperRnotes member

12351. By Amos Jeffries

Typo in HttpRequest

12350. By Amos Jeffries

Merged from trunk

12349. By Amos Jeffries

Add kv-pir support to url_rewrite_helper interface

This stage of the helper reply protocol adds kv-pair support to the
url_rewrite_helper interfacefor URL redirect and rewrite operations.

It uses the new Notes objects and kv-pair field added by the stage 2
helper protocol instead of parsing the 'other' field. Although,
the 'other' field is still parsed when *no* result field is received
for backward compatibility with older helpers.

The response syntax for URL helpers becomes:
  [channel-ID SP] result [SP kv-pair ...] [SP other] EOL

NP: 'other' field is now deprecated and will be ignored/discarded on any
  response containing a result code field.

When result code "OK" is presented by the helper several kv-pairs are
reserved to control Squid actions:

* "rewrite-url=" is added to return a re-written URL.
 - When this key is presented the URL is re-written to the new one by
   Squid without client interaction.
 - The 'url' keys presence will override this key.

* "url=" is added to return the redirected-to URL.
 - When this key name is presented an HTTP redirect response is generated
   for the client.
 - This keys presence overrides the 'rewrite-url' key actions.

* "status=" is added to hold the HTTP status code for use in redirect
  operations.
 - This field is optional and status is no longer required for marking
   redirect actions.
 - If no redirect status is provided Squid will assign one (currently the
   default is 302, that may change in the future).
 - This key is only relevant when 'url' key is also presented. In all
   other uses it is currently ignored.

When result codes BH or ERR are presented by the helper no redirect or
rewrite action is performed and no kv-pair key names are reserved for use
at this time.

Any other keys MAY be sent on any response. The URL helper interface
makes no other use of them, but this patch does pass them on to the ALE
object for logging as transaction Notes. All kv-pairs returned by the
helper (including the url, stauts rewrite-url keys) are available for
logging via the %{...}note log format option.

As with changes to other helpers interfaces in earlier updates, only
the first value presented for any of the reserved kv-pairs is used.
Multiple values are accepted as notes, but otherwise ignored by Squid and
do not affect the transaction outcome.

Additionally, when the BH result code is received from the helper a
simple recovery is attempted. The lookup request will be re-scheduled (up
to once) in an attempt to find a better responding helper.

NOTE: Helper notes are *not* passe to adaptation interfaces.
 - REQMOD adaptation happens before URL helpers are used.
 - REPMOD adaptation may at some point receive them, but that change is
   not done by this update.

 This update was sponsored by Edgewave.

12348. By Amos Jeffries

Stage 2 synced with trunk

12347. By Amos Jeffries

Merged from trunk

12346. By Amos Jeffries

Audit Review updates

* guarantee that note values output by the HelperReply parser are ""
  nil-terminated string and not undefined String.
* rename HelperReply::responseKeys to 'notes'
* rename Notes::findByName() to find()
* add Note::firstValue() to locate first value provided for a given key
  and present it as a char* terminated string
* various documentation updates

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
This branch contains Public information 
Everyone can see this information.

Subscribers