req.hash not a string (when?)

T. Pascal t_pascal at zennet.com
Wed Aug 11 23:27:27 CEST 2010


Trying to look at the hash string can be useful for debugging,
especially if there are huge, ugly regsub going on:

Message from VCC-compiler:
String representation of 'req.hash' not implemented yet.
(input Line -- Pos 50)
                set req.http.X-Varnish-HashKey = req.hash;
-------------------------------------------------########-
Running VCC-compiler failed, exit 1

Current workaround is to repeat the ugly, unmaintainable code twice:

                set req.hash += regsub(regsub(regsub(req.url,
"^([/]xxx[?])[^&]*[&]?(q=[^&]*).*$", "\1\2"),"(%2520|
|\+)+xxs:.*$",""),"(%2520| |\+)+-xxx.*$","");
                set req.http.X-Varnish-HashKey =
regsub(regsub(regsub(req.url, "^([/]xxx[?])[^&]*[&]?(q=[^&]*).*$",
"\1\2"),"(%2520| |\+)+xxx:.*$",""),"(%2520| |\+)+-xxx.*$","");


Just wondering when/if req.hash can be used like the above error (or,
with the new "log" feature)?

-T.




More information about the varnish-dev mailing list