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:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user