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

@@ -307,6 +307,14 @@ double RateMeter::getCurrentByteRate(const struct timeval *now, bool update) {
return current_byte_rate;
}
unsigned long long RateMeter::getNumPackets(void) const {
return num_packets;
}
unsigned long long RateMeter::getNumBytes(void) const {
return num_bytes;
}
/* Update the rates to include packets additional packets and bytes additional
bytes. If now is not NULL, use it as the time the packets and bytes were
received rather than calling gettimeofday. */