[PATCH] Error page format codes upgrade

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sun, 02 Jun 2013 23:08:56 +1200

On 7/04/2013 5:48 p.m., Amos Jeffries wrote:
> What this does is convert ErrorState object to using the generic
> libformat.la parser and macro expansions instead of its own rather
> limited custom ones for error pages and deny_info URL creation.

Alex: If possible could you guys throw this through WebPolygraph to see
if the different in parsing shows up at all?
I'm checking the performance variance for error-only workload now.

> Change Summary:
> 1) register the 1-byte error page macros as libformat codes
> 2) convert the ErrorState::Convert macro expander to use those codes
> instead of char literals
> 3) extend the libformat to handle several process-wide informational
> macros and a human-readabhe RFC1123 time format
> 4) extend the Format::assemble method to call the adapted
> ErrorState::Convert function when it encounters byte codes requiring
> ErrorState special handling
> 5) convert the ErrorState::ConvertText and
> ErrorState::DenyInfoLocation methods to use the libformat API to parse
> and assemble the output page
>
> NOTES on problems remaining:
> *a) Several of the error page macros are better served by other
> logformat macro expansions. However on some the interaction between
> deny_info and ERR_* template usages has required that the
> ErrorState::Convert logics be used for now.
>
> *b) Doing a whole parse cycle for every error response is very costly.
> We are already loading the text page files on every error response.
> This adds the un-optimized libformat parser lag on top of that. To
> avoid this we really need to add a cache for error page templates and
> strings, such that each one is only loaded and parsed once. From that
> we can more speedily assemble the expansions final output.
>
> *c) For now AccessLogEntry required by the libformat API is generated
> by ErrorState just before use. Ideally the code creating the
> ErrorState should pass it an already filled out ALE object for the
> transaction. This way we will get a lot more of the libformat macros
> filled out. That is done in a few places where easily possible, but
> many places still cannot do it. This restricts the format codes which
> will work on any given error.

Amos

Received on Sun Jun 02 2013 - 11:09:20 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 10 2013 - 12:00:22 MDT