From 5cba09a88306f5b5131e5ddbe41a3eadb3996b35 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 26 Mar 2008 02:47:42 +0000 Subject: [PATCH] Make the display of sending rates dependent on -d. --- scan_engine.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scan_engine.cc b/scan_engine.cc index 6943c315c..738d89964 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -4787,12 +4787,14 @@ void ultra_scan(vector &Targets, struct scan_lists *ports, avgdone /= USI->gstats->numtargets; USI->SPM->printStats(avgdone, NULL); // This prints something like SYN Stealth Scan Timing: About 1.14% done; ETC: 15:01 (0:43:23 remaining); - /* Don't update when getting the current rates, otherwise we can get - anomalies (rates are too low) from having just done a potentially long - waitForResponses without sending any packets. */ - log_write(LOG_STDOUT, "Current sending rates: %.2f packets / s, %.2f bytes / s.\n", - USI->send_rate_meter.getCurrentPacketRate(&USI->now, false), - USI->send_rate_meter.getCurrentByteRate(&USI->now, false)); + if (o.debugging) { + /* Don't update when getting the current rates, otherwise we can get + anomalies (rates are too low) from having just done a potentially + long waitForResponses without sending any packets. */ + log_write(LOG_STDOUT, "Current sending rates: %.2f packets / s, %.2f bytes / s.\n", + USI->send_rate_meter.getCurrentPacketRate(&USI->now, false), + USI->send_rate_meter.getCurrentByteRate(&USI->now, false)); + } log_flush(LOG_STDOUT); @@ -4819,6 +4821,8 @@ void ultra_scan(vector &Targets, struct scan_lists *ports, USI->gstats->num_hosts_timedout, (USI->gstats->num_hosts_timedout == 1)? "host" : "hosts"); USI->SPM->endTask(NULL, additional_info); + } + if (o.debugging) { log_write(LOG_STDOUT, "Overall sending rates: %.2f packets / s, %.2f bytes / s.\n", USI->send_rate_meter.getOverallPacketRate(), USI->send_rate_meter.getOverallByteRate());