1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-27 01:49:03 +00:00

fixed a bug in a loop where the script would wait for a condition that was

supposed to be signalled by other threads which were no longer running.
This commit is contained in:
patrik
2012-08-29 05:37:56 +00:00
parent c71478d91f
commit 448bb5a71b
22 changed files with 72 additions and 26 deletions

View File

@@ -239,7 +239,6 @@ local function worker_scheduler(host, port)
while not DOSed and not StopAll do
-- keep creating new threads, in case we want to run the attack indefinitely
repeat
condvar("wait")
if StopAll then
return
end
@@ -252,6 +251,9 @@ local function worker_scheduler(host, port)
stdnse.print_debug(SCRIPT_NAME .. " [SCHEDULER]: starting new thread")
local co = stdnse.new_thread(do_half_http, host, port, obj)
Threads[co] = true
if ( next(Threads) ) then
condvar("wait")
end
until next(Threads) == nil;
end
end