mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
o Fixed a division by zero error in the packet rate measuring code
that could cause a display of infinity packets per seconds near the start of a scan. [Jah]
This commit is contained in:
parent
7922c3edb5
commit
9fe196bb0b
2 changed files with 11 additions and 1 deletions
|
|
@ -1,5 +1,9 @@
|
|||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o Fixed a division by zero error in the packet rate measuring code
|
||||
that could cause a display of infinity packets per seconds near the
|
||||
start of a scan. [Jah]
|
||||
|
||||
o Complete re-write of the marshalling logic for Microsoft RPC calls.
|
||||
[Ron Bowes]
|
||||
|
||||
|
|
|
|||
|
|
@ -349,7 +349,13 @@ void RateMeter::update(double amount, const struct timeval *now) {
|
|||
}
|
||||
|
||||
double RateMeter::getOverallRate(const struct timeval *now) const {
|
||||
return total / elapsedTime(now);
|
||||
double elapsed;
|
||||
|
||||
elapsed = elapsedTime(now);
|
||||
if (elapsed <= 0.0)
|
||||
return 0.0;
|
||||
else
|
||||
return total / elapsed;
|
||||
}
|
||||
|
||||
/* Get the "current" rate (actually a moving average of the last
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue