1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-26 09:29:01 +00:00

Prevent system from going to sleep during scans. Fixes #1192

This commit is contained in:
dmiller
2022-09-21 21:31:14 +00:00
parent e3ab97215d
commit e8271b7070
4 changed files with 17 additions and 0 deletions

View File

@@ -2777,6 +2777,10 @@ void ultra_scan(std::vector<Target *> &Targets, const struct scan_lists *ports,
/* Otherwise, no sniffer needed! */
while (!USI.incompleteHostsEmpty()) {
#ifdef WIN32
// Reset system idle timer to avoid going to sleep
SetThreadExecutionState(ES_SYSTEM_REQUIRED);
#endif
doAnyPings(&USI);
doAnyOutstandingRetransmits(&USI); // Retransmits from probes_outstanding
/* Retransmits from retry_stack -- goes after OutstandingRetransmits for