From 5e9c3dea5aedfb4f5c5741da6b23c391da3fad83 Mon Sep 17 00:00:00 2001 From: batrick Date: Wed, 25 Nov 2009 00:59:46 +0000 Subject: [PATCH] Remove dead threads from the all table as they are no longer valid. --- nse_main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nse_main.lua b/nse_main.lua index 498a9cdf2..19b405f72 100644 --- a/nse_main.lua +++ b/nse_main.lua @@ -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