]> err.no Git - varnish/commit
Teach the VCL compiler about default functions, so that users will
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 12 Jul 2006 08:34:48 +0000 (08:34 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 12 Jul 2006 08:34:48 +0000 (08:34 +0000)
commit6338756a58488a335add4894ceaf21bb75488bd3
treecde6f6dc334d9e9f62b4b4c4abafa193c274493c
parent6de5b720ab858db6fce8b6f28586662e33c1349d
Teach the VCL compiler about default functions, so that users will
not have to copy&paste the default methods if they have no special
requirements for a particular method.

No such facility exists for backends, so a backend description is
now the minumum VCL program.

When we initialize the VCL compiler we hand it a piece of source code
with the "default code", this must include definitions of all methods
named with a "default_" prefix (ie: "default_vcl_recv" etc).

During compilation we always compile this piece of source code in (after
the user supplied VCL source).

If the user did not provide a particular method, the default method is
used instead.  The user can also call the default method directly,
for instance by:

sub vcl_recv {
if (req.http.Expect) {
error;
}
call default_vcl_recv;
}

Later on, this could be expanded to allow other subroutines to be
included in the default VCL for the users calling convenience.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@449 d4fa192b-c00b-0410-8231-f00ffab90ce4
varnish-cache/bin/varnishd/varnishd.c
varnish-cache/include/libvcl.h
varnish-cache/lib/libvcl/vcl_compile.c