mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 06:01:28 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user