Hi Brian,
Yes TCL and iRules use short circuit logic:
when RULE_INIT {
if { 0 && $nonexistentvariable} {
log local0. "got here"
} else {
log local0. "short circuited"
}
}
< RULE_INIT>: short circuited
Compare the output with || logic to hit the nonexistent variable:
when RULE_INIT {
if { 0 || $nonexistentvariable} {
log local0. "got here"
} else {
log local0. "short circuited"
}
}
TCL error: short_circuit_rule < RULE_INIT> - can't read "nonexistentvariable": no such variable while executing "if { 0 || $nonexistentvariable} { log local0. "got here" } else { log local0. "short circuited" }"
If you want to exit out of a specific iRule event for the current request only, you can use the return command:
https://devcentral.f5.com/wiki/iRules.return.ashx
And you have break and continue for loops:
http://www.tcl.tk/man/tcl8.4/TclCmd/break.htm
http://www.tcl.tk/man/tcl8.4/TclCmd/continue.htm
Or do you have a more specific example you're thinking of?
Aaron