[squid-dev] [PATCH] ICAP trailer support

Amos Jeffries squid3 at treenet.co.nz
Wed Nov 9 15:16:49 UTC 2016

On 9/11/2016 3:05 a.m., Eduard Bagdasaryan wrote:
> Hello,
> This patch introduces the initial ICAP trailer support. ICAP trailers are
> currently specified by
> https://datatracker.ietf.org/doc/draft-rousskov-icap-trailers/. For now,
> Squid logs and ignores all parsed ICAP header fields.  In future we plan
> to add code for using ICAP trailers for transaction annotations and
> access logging.
> Also refactored HttpHeader parsing methods in order to reuse them for
> ICAP trailer parsing.
> Also simplified and fixed headers isolating code while dealing with
> empty (i.e. zero header fields) headers. Old httpMsgIsolateHeaders()
> tried to re-implement header end detection/processing logic that is
> actually covered by headersEnd(). Old httpMsgIsolateHeaders() could
> return success for some garbage input (e.g., a buffer of several CRs)
> even if no end of headers was found.

Careful there. Since HttpMsg is actually HTTP parse logic a buffer
containing several CR's can be a valid mime block (just empty). CR is
part of BWS/OWS in HTTP.

In Adaptation::Icap::ModXact::expectIcapTrailers() please use
getByIdIfPresent(Http::TRAILER, ...) since Trailer is a registered header.

In answer to "TODO: should we add a new Http::scInvalidTrailer?"
 - only if the draft defines an HTTP 5xx status code called "Ivalid
Trailer". Since the Http::sc* are HTTP status codes.

Thats all I have for now after a quick read through.


More information about the squid-dev mailing list