cancel
Showing results for 
Search instead for 
Did you mean: 

HSSR maxtime

danA
Nimbostratus
Nimbostratus

Hi -

I'm writing an iRule using the HSSR HTTP client and am specifying the -maxtime argument. It looks like there are a couple of issues in how maxclock is computed.

The 'maxtime' argument is specified in seconds as is 'wait', but 'timeout' is in millis, which in most cases should put 'maxclock' somewhere in the past. Also, if the maxtime is not larger than 'timeout' + 'wait', it can also be in the past.

 

if {$maxtime} {
set maxclock [expr {[clock seconds] + $maxtime - ($timeout + $wait)}]
}

Does anyone else use -maxtime? Am I off?

For myself, I've changed the code above to correct for these issue:

set timeout_sec [expr {$timeout / 1000}]
if {$maxtime} {
set now [clock seconds]
set maxclock [expr {[clock seconds] + $maxtime - ($timeout_sec + $wait)}]
if {$maxclock <= [expr $now + $maxtime]} {
set maxclock [expr $now + $maxtime]
}
}

Dan

0 REPLIES 0