Re: ErrorState structure question

From: Allen Wittenauer <allenw@dont-contact.us>
Date: Mon, 24 Dec 2001 08:18:48 -0800

On Monday, December 24, 2001, at 03:11 AM, Henrik Nordstrom wrote:

> The headers are in ErrorState->request->header, accessed via the
> httpHeaderGet* family of calls.

Thanks!

I'm working on adding--at least rudimentary--support for Accept-Language
and Accept-Charset support for the error pages, so squid can return the
proper error page based on the user's settings, rather than always going
with the default language or having to use the multilang hack in the
error's directory Makefile.

I did some playing around yesterday and already figured out that my
hunch was correct. :) I've got errorpage.c responding to 2 letter ISO
country codes by pulling apart HDR_ACCEPT_LANGUAGE and grabbing the
first 2 characters of each list item. It then tries to open each
language listed... first one that opens, wins. This is probably a bit
of a performance loss, but given that it is for the error pages... :)
Long term, all of the error pages should probably be loaded into a
B-tree type structure that is memory resident.

I plan on adding charset support either today or maybe after Xmas, since
the Russian and Chinese error files pretty much require it. So far, the
changes are fairly isolated to errorpage.c, but it does require that the
language directory get rewritten to match the country codes (English
becomes en, French becomes fr, etc). I suppose it would probably be
better to have a language and character set translation table in the
squid.conf. Thoughts?
Received on Mon Dec 24 2001 - 18:50:36 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:41 MST