AndrewO_4840
Feb 12, 2009Nimbostratus
How can this fail?
I'm using a variation of the request rate limiting iRule ( http://devcentral.f5.com/wiki/default.aspx/iRules/HTTPRequestThrottle.html ) - it's essentially the same without the whitelist or blacklist features.
The rule breaks on the line:
set elapsed_time [expr {$curr_time - $start_time}}
and throws the error:
> - can't use empty string as operand of "-" while executing "expr {$curr_time - $start_time}"
This rule contains the lines:
set curr_time [clock seconds]
and:
set request_count [session lookup uie $reqkey]
if {$request_count > 0} {
set start_time [session lookup uie $timekey]
...
Since $curr_time is defined, and $start_time is defined if the session lookup returns some value, how can either of them be 0 and cause my iRule to fail?