Re: [squid-users] squid.conf: continuation lines?

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sun, 13 May 2001 03:27:10 +0200

Robert Collins wrote:

> Cool. The config parser I've mostly built is all refcounted. (Built as
> cbdata now, once I've propogated the changes everywhere I'll get dump
> going again and then write a proper refcounting equivalent to cbdata. At
> that point reconfigure should no longer be broken and I'll look at
> asking for HEAD inclusion of some of the branch.

Actually for quite many config items it makes sense to use cbdata.

* Main pointer linked in Config
* Other modules uses a cbdata reference while referring to that
configuration entry.
* When the configuration is freed, cbdataFree() is used, making all
references !cbdataValid().

A good example are peers.

> However I have _no_ idea how to implement file watching in unix (doesn't
> it require a signal?) at all, let alone portably :] We could walk the
> config tree for file nodes every minute or two and re-read that node
> though.

A common way to do it is to use stat(), and reread the file it if has
another modification time or size than the last time it was read and the
current modification time is sufficiently old (lets say 10 seconds).

stat() should be fairly portable (100% within the UNIX world at least),
but is not part of standard-C.

--
Henrik
Received on Sat May 12 2001 - 19:36:42 MDT

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