From 67f31fd170ba4bd883f2d58e10e714a06503fafc Mon Sep 17 00:00:00 2001 From: batrick Date: Wed, 15 Jul 2009 14:16:14 +0000 Subject: [PATCH] Fixed a global access for 'opts' using check_globals script. --- nselib/http.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nselib/http.lua b/nselib/http.lua index d3e14371e..6a922fd54 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -303,6 +303,7 @@ end -- * header: A table containing additional headers to be used for the request. -- * content: The content of the message (content-length will be added -- set header['Content-Length'] to override) request = function( host, port, data, options ) + local opts options = options or {} if type(host) == 'table' then @@ -330,10 +331,10 @@ request = function( host, port, data, options ) end if options.timeout then - local opts = {timeout=options.timeout, recv_before=false} + opts = {timeout=options.timeout, recv_before=false} else local df_timeout = get_default_timeout( nmap.timing_level() ) - local opts = {connect_timeout=df_timeout.connect, request_timeout = df_timeout.request, recv_before=false} + opts = {connect_timeout=df_timeout.connect, request_timeout = df_timeout.request, recv_before=false} end local response = {}