From 46711fa004a6328cc2eaaffcdb9f4e85438d4898 Mon Sep 17 00:00:00 2001 From: ron Date: Wed, 26 Aug 2009 16:01:00 +0000 Subject: [PATCH] Fixed a big in the http library that cropped up while scanning multiple hosts at the same ip address. The reason this occurred is because the result would be cached based on the ip address, not the target name, so different vhosts on the same ip address would be considered the same by the cache. --- nselib/http.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nselib/http.lua b/nselib/http.lua index 9b64efb14..76bc39eaf 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -555,10 +555,9 @@ local function lookup_cache (method, host, port, path, options) local no_cache = options.no_cache; -- do not save result local no_cache_body = options.no_cache_body; -- do not save body - if type(host) == "table" then host = host.ip end if type(port) == "table" then port = port.number end - local key = host..":"..port..":"..path; + local key = get_hostname(host)..":"..port..":"..path; local mutex = nmap.mutex(tostring(lookup_cache)..key); local state = {