Forum Discussion
danA
Jun 03, 2022Altostratus
HSSR maxtime
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
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects