Forum Discussion
hooleylist
Mar 07, 2008Cirrostratus
TCL does support boolean short circuiting. So if the first test is anded with the second and the first one fails, the second test isn't attempted.
What are you trying to accomplish though? If it's better error handling, I think using 'catch' command would be more optimal.
I don't think the pool command will return any value if the pool exists so it wouldn't be valid boolean result. If the pool doesn't exist, you'll see a TCL error and the connection will be killed.
You can use syntax like that with iRules, but you'd need to keep in mind what the commands return as standard output.
For example this work to only try to decrypt a cookie if the value of the cookie has a length:
if {[string length [HTTP::cookie value $::my_cookie_name]] and [HTTP::cookie decrypt $::my_cookie_name $::my_cookie_passphrase] eq "my-site_[IP::client_addr]"}{
Aaron