1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-14 17:36:33 +00:00

Remove dead threads from the all table as they are no longer valid.

This commit is contained in:
batrick
2009-11-25 00:59:46 +00:00
parent c7e710515e
commit 5e9c3dea5a

View File

@@ -596,7 +596,7 @@ local function run (threads)
-- Checked for timed-out hosts.
for co, thread in pairs(waiting) do
if cnse.timedOut(thread.host) then
waiting[co] = nil;
waiting[co], all[co] = nil, nil;
thread:d("%THREAD %s%s timed out", thread.host.ip,
thread.port and ":"..thread.port.number or "");
thread:close();
@@ -609,7 +609,7 @@ local function run (threads)
local s, result = resume(co, unpack(thread.args, 1, thread.args.n));
if not s then -- script error...
hosts[thread.host][co] = nil;
hosts[thread.host][co], all[co] = nil, nil;
thread:d("%THREAD against %s%s threw an error!\n%s\n",
thread.host.ip, thread.port and ":"..thread.port.number or "",
traceback(co, tostring(result)));
@@ -623,7 +623,7 @@ local function run (threads)
thread:close();
end
elseif status(co) == "dead" then
hosts[thread.host][co] = nil;
hosts[thread.host][co], all[co] = nil, nil;
if type(result) == "string" then
-- Escape any character outside the range 32-126 except for tab,
-- carriage return, and line feed. This makes the string safe for