1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-31 20:09:02 +00:00

Honor the options table in http.request (specifically options.timeout).

I think this was supposed to work but it was broken.
This commit is contained in:
david
2010-02-19 05:06:57 +00:00
parent 752fd5331b
commit 4178846c05

View File

@@ -940,12 +940,13 @@ end
-- * <code>cookies</code>: A table of cookies in the form returned by <code>parse_set_cookie</code>.
-- @return A table as described in the module description.
-- @see generic_request
request = function(host, port, data)
request = function(host, port, data, options)
local method
local opts
local header, partial
local response
options = options or {}
if type(host) == 'table' then
host = host.ip
end
@@ -962,7 +963,7 @@ request = function(host, port, data)
method = string.match(data, "^(%S+)")
socket, partial = comm.tryssl(host, port, data, opts)
socket, partial = comm.tryssl(host, port, data, { timeout = options.timeout })
if not socket then
return error_response