From cbf901c1951155aa97e5e3b5a22da45888e065cd Mon Sep 17 00:00:00 2001 From: patrik Date: Tue, 22 May 2012 18:22:18 +0000 Subject: [PATCH] added coded to stop spidering if the base coroutine is dead. --- nselib/httpspider.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nselib/httpspider.lua b/nselib/httpspider.lua index c52565b46..b0302a7bb 100644 --- a/nselib/httpspider.lua +++ b/nselib/httpspider.lua @@ -501,6 +501,7 @@ Crawler = { port = port, url = url, options = options or {}, + basethread = stdnse.base(), } setmetatable(o, self) @@ -606,7 +607,7 @@ Crawler = { while(true) do - if ( self.quit ) then + if ( self.quit or coroutine.status(self.basethread) == 'dead' ) then table.insert(response_queue, {false, { err = false, msg = "Quit signalled by crawler" } }) break end