From 4178846c05b694844b13953ba0251aa60555693b Mon Sep 17 00:00:00 2001 From: david Date: Fri, 19 Feb 2010 05:06:57 +0000 Subject: [PATCH] Honor the options table in http.request (specifically options.timeout). I think this was supposed to work but it was broken. --- nselib/http.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nselib/http.lua b/nselib/http.lua index 9b1686645..12993027b 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -940,12 +940,13 @@ end -- * cookies: A table of cookies in the form returned by parse_set_cookie. -- @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