1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-03 05:09:14 +00:00

Change o.TimeSinceStartMS returning milliseconds to o.TimeSinceStart

returning floating-point seconds. Everywhere o.TimeSinceStartMS was
called, the return value was being divided by 1000.0, which had the same
effect but would overflow when the difference exceeded about 25 days
(2^31 milliseconds). This patch is by Daniel Miller.
This commit is contained in:
david
2011-03-28 20:34:32 +00:00
parent 0fb893af03
commit 7453ec34d0
7 changed files with 20 additions and 17 deletions

View File

@@ -523,7 +523,7 @@ public:
resetHostIterator() afterward). Don't let this list get empty,
then add to it again, or you may mess up nextI (I'm not sure) */
list<HostOsScanInfo *> incompleteHosts;
unsigned int starttimems;
float starttime;
unsigned int numIncompleteHosts() {return incompleteHosts.size();}
HostOsScanInfo *findIncompleteHost(struct sockaddr_storage *ss);
@@ -2886,7 +2886,7 @@ int OsScanInfo::removeCompletedHosts() {
if (remain && !timedout)
log_write(LOG_STDOUT, "Completed os scan against %s in %.3fs (%d %s)\n",
hsi->target->targetipstr(),
(o.TimeSinceStartMS() - this->starttimems) / 1000.0, remain,
o.TimeSinceStart() - this->starttime, remain,
(remain == 1)? "host left" : "hosts left");
else if (timedout)
log_write(LOG_STDOUT, "%s timed out during os scan (%d %s)\n",
@@ -3747,7 +3747,7 @@ static int os_scan_2(vector<Target *> &Targets) {
delete OSI;
return 1;
}
OSI->starttimems = o.TimeSinceStartMS();
OSI->starttime = o.TimeSinceStart();
HOS = new HostOsScan(Targets[0]);
startTimeOutClocks(OSI);