I am currently on Varnish 2.1.5. Looks like that vmod_std module was added in 3.x version. I was hoping to avoid getting into writing C code for this. Any other ideas?
> > I am getting the value of a cookie and then trying to compare it to another > integer value but am getting a compile error. Can I compare integers stored > in the req object? Should I be going about this a different way? Use the conversion method in vmod_std: https://www.varnish-cache.org/docs/trunk/reference/vmod_std.html#integer -- Andreas On 11/16/11 6:06 AM, "Lane, Richard" <[email protected]> wrote: Is anyone comparing cookie values that are integers? I am getting the value of a cookie and then trying to compare it to another integer value but am getting a compile error. Can I compare integers stored in the req object? Should I be going about this a different way? For example: --sitename.vcl sitename_recv{ set req.http.compareVal=10; set req.http.cookieVal=5; call cookieValCompare; } sub cookieValCompare{ if( req.http.cookieVal < req.http.compareVal) { #do something extra } } If I try to compile via the console I get: Message from VCC-compiler: Expected ')' got '<' (program line 109), at (/etc/varnish/sitename.vcl Line 11 Pos 28) if( req.http.cookieVal < req.http.compareVal ) ---------------------------------#----------------------------- Running VCC-compiler failed, exit 1VCL compilation failed Command failed with error code 106
_______________________________________________ varnish-misc mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
