Re: 'include' directive in squid-2.HEAD

From: Adrian Chadd <adrian@dont-contact.us>
Date: Tue, 8 Jan 2008 13:30:47 +0900

On Tue, Jan 08, 2008, Robert Collins wrote:

> > I looked at this for 3.1, but the config parser there confused me with
> > its multiple meanings of 'file'.
> > I'd definately like to see how you are doing it in 2 for a side-port.
>
> I implemented one about 5 years back. Now where did I put it .... it's
> not in my local arch repo; it may be on devel.

It really wasn't hard:

* break out parseConfigFile() into two parts, one that parsed a file, one
  that did the extra stuff (set defaults, call parseOneConfigFile(squid.conf);
  check error counts, finalise the cnfig.)
* parseOneConfigFile() does the line/config parsing, and handles calling itself
  for files referenced via "include".
* there's a pair of globals used for config file and line numbers - shows up in
  acl.c mainly - so make sure you save and restore these each pass through
  parseOneConfigFile().

(Wow, I finally had a chance to write recursive code in Squid..)

Adrian
Received on Mon Jan 07 2008 - 21:21:49 MST

This archive was generated by hypermail pre-2.1.9 : Wed Jan 30 2008 - 12:00:09 MST