03-Jun-2022 09:54 - edited 03-Jun-2022 10:30
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
22-May-2023 10:49 - edited 22-May-2023 10:50
Hi @danA ,
I haven't used the HSSR so I don't have much to help on your inquiry, but thanks for sharing your update to the maxtime handling!