Subject: | Timing bug with _event_create |
The _event_create sub in Net::SNMP::Dispatcher has some odd logic with
processing times vs. delays, which is creating zero-epoch dates for
events. While the Dispatcher seems to fire these okay, it affects the
midpoint insertion code and exactly how _event_handle prioritizes the
events. The code in question looks like:
$this->{_active} ? time() + $time : $time, # Execution time
It should look like the time variable itself, not the active state,
which doesn't make much sense. This works better:
($time < 100000000) ? time() + $time : $time, # Execution time
This merely looks for a properly large time epoch and uses it as such,
else assume it's a delay value. Unless the user wants Net::SNMP to wait
3 years before polling something, the logic works fine.
Similar code is also found in _event_init and should be changed as such.