mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
o [NSE] Added stop function to crawler so that scripts can properly shutdown
the crawler in case they want to end early. [Patrik]
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
# Nmap Changelog ($Id$); -*-text-*-
|
# Nmap Changelog ($Id$); -*-text-*-
|
||||||
|
|
||||||
|
o [NSE] Added stop function to crawler so that scripts can properly shutdown
|
||||||
|
the crawler in case they want to end early. [Patrik]
|
||||||
|
|
||||||
o [NSE] Fixed issue in path encoding in the http-backup-finder script. [Patrik]
|
o [NSE] Fixed issue in path encoding in the http-backup-finder script. [Patrik]
|
||||||
|
|
||||||
o [NSE] Added the script http-backup-finder that searches for backup copies
|
o [NSE] Added the script http-backup-finder that searches for backup copies
|
||||||
|
|||||||
@@ -561,6 +561,12 @@ Crawler = {
|
|||||||
end
|
end
|
||||||
|
|
||||||
while(true) do
|
while(true) do
|
||||||
|
|
||||||
|
if ( self.quit ) then
|
||||||
|
table.insert(response_queue, {false, { err = false, msg = "Quit signalled by crawler" } })
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
-- in case the user set a max page count to retrieve check how many
|
-- in case the user set a max page count to retrieve check how many
|
||||||
-- pages we have retrieved so far
|
-- pages we have retrieved so far
|
||||||
local count = self:getPageCount()
|
local count = self:getPageCount()
|
||||||
@@ -607,6 +613,7 @@ Crawler = {
|
|||||||
end
|
end
|
||||||
condvar "signal"
|
condvar "signal"
|
||||||
end
|
end
|
||||||
|
condvar "signal"
|
||||||
end,
|
end,
|
||||||
|
|
||||||
-- Loads the argument set on a script level
|
-- Loads the argument set on a script level
|
||||||
@@ -690,5 +697,14 @@ Crawler = {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
-- signals the crawler to stop
|
||||||
|
stop = function(self)
|
||||||
|
local condvar = nmap.condvar(self.response_queue)
|
||||||
|
self.quit = true
|
||||||
|
condvar "signal"
|
||||||
|
condvar "wait"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user