Mapping VCL variables to internal variables

Poul-Henning Kamp phk at phk.freebsd.dk
Thu May 22 22:25:34 CEST 2008


In message <20080521185714.GC6756 at charlescurley.com>, Charles Curley writes:

>I'd like to set a variable in VCL, and then use it in a modification
>of Varnish. Having added to req.hash with something like:
>
>sub vcl_hash
>{
>if (req.http.Accept-Encoding ~ "gzip") {
>set req.hash +=3D "gzip";
>} else if (req.http.Accept-Encoding ~ "deflate") {
>set req.hash +=3D "deflate";
>}
>}
>
>where do I find that in Varnish itself?

See cache_center.c::cnt_lookup() [search for "VCL_hash_method(sp);"],
and cache_hash.c::HSH_Copy(), HSH_Compare() and HSH_Lookup().

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list