1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 12:41:29 +00:00

Reduce CPU consumption with nsock engine poll

Entering nsock_loop() with the poll engine activated and no registered FD
(timers only, for instance) should not directly return, but sleep until next
timeout.
This commit is contained in:
henri
2015-02-21 21:15:21 +00:00
parent 7b02dea019
commit d7a3d43eb6
2 changed files with 5 additions and 5 deletions

View File

@@ -1,5 +1,9 @@
# Nmap Changelog ($Id$); -*-text-*-
o Reduce CPU consumption when using nsock poll engine with no registered FD,
by actually calling Poll() for the time until timeout, instead of directly
returning zero and entering the loop again. [Henri Doreau]
o Fix ICMP Echo (-PE) host discovery for IPv6, broken since 6.45, caused by
failing to set the ICMP ID for outgoing packets which is used to match
incoming responses. [Andrew Waters]

View File

@@ -347,11 +347,7 @@ int poll_loop(struct npool *nsp, int msec_timeout) {
#endif
#endif
{
if (pinfo->max_fd > -1)
results_left = Poll(pinfo->events, pinfo->max_fd + 1, combined_msecs);
else
results_left = 0;
if (results_left == -1)
sock_err = socket_errno();
}