]> err.no Git - varnish/commit
Add a facility to constructing a synthetic object from VCL.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 25 Jul 2008 16:33:04 +0000 (16:33 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 25 Jul 2008 16:33:04 +0000 (16:33 +0000)
commit5bc35b5f4089d19f04e7efbba4812ad259a84a8b
treec5ee30b3e2cda28d9626a431593d3d5de2aa6d7b
parent7cbd309d9b59aa4fc3d9ef2daac724c9d5ed6bdc
Add a facility to constructing a synthetic object from VCL.

This is just the initial version and it doesn't quite work the way
we need it to yet, but the idea is to be able to say:

sub vcl_fetch {
    if (obj.status == 503) {
synthetic {"
    <HTML>
    <H1>Sorry, could not contact the backend server</H1>
    <P>
Try again later.
    </P>
    <HR>
    <PRE>
URL: "}  req.url {"
User Agnet: "} req.http.user-agent {"
    </PRE>
    </HTML>
"};
    }
}

A new VCL syntactic element have been introduced to do this: "the
long string".   A long string is anything from {" to "}, newlines,
controlcharacters and all.  (Normal "..." strings cannot contain
control characters.

Technical details:

Don't NULL terminate string sequences in VRT context, we may have
NULL cropping up as a legal value if a header is missing, add the
magic "vrt_magic_string_end" for terminating string contactenation.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3026 d4fa192b-c00b-0410-8231-f00ffab90ce4
varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_hash.c
varnish-cache/bin/varnishd/cache_vrt.c
varnish-cache/include/stat_field.h
varnish-cache/include/vrt.h
varnish-cache/lib/libvcl/vcc_action.c
varnish-cache/lib/libvcl/vcc_fixed_token.c
varnish-cache/lib/libvcl/vcc_token.c