1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-14 09:26:35 +00:00

Print a partial taskprogress when perc_done is less than 1%. Fixes #1351

This commit is contained in:
dmiller
2018-10-11 04:47:20 +00:00
parent 53f5f5652e
commit dc238cf08b

View File

@@ -703,7 +703,13 @@ bool ScanProgressMeter::printStats(double perc_done,
if (perc_done < 0.01) {
log_write(LOG_STDOUT, "%s Timing: About %.2f%% done\n",
scantypestr, perc_done * 100);
log_flush(LOG_STDOUT);
xml_open_start_tag("taskprogress");
xml_attribute("task", "%s", scantypestr);
xml_attribute("time", "%lu", (unsigned long) now->tv_sec);
xml_attribute("percent", "%.2f", perc_done * 100);
xml_close_empty_tag();
xml_newline();
log_flush(LOG_STDOUT|LOG_XML);
return true;
}