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

Reply via email to