1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Avoid showing the sending rate in bytes per second if no sent bytes have been

recorded. This applies during a TCP connect scan, where we have a count of
packets sent but not of bytes (which we cannot measure, and will vary from
platform to platform).
This commit is contained in:
david
2008-07-23 22:21:37 +00:00
parent 18a4caff83
commit 625d88293e
3 changed files with 30 additions and 14 deletions

View File

@@ -142,6 +142,8 @@ class RateMeter {
double getCurrentPacketRate(const struct timeval *now = NULL, bool update =true);
double getOverallByteRate(const struct timeval *now = NULL) const;
double getCurrentByteRate(const struct timeval *now = NULL, bool update =true);
unsigned long long getNumPackets(void) const;
unsigned long long getNumBytes(void) const;
private:
/* How many seconds to look back when calculating the "current" rates. */