From 598d94f6f5a50ffaf42ff7a8173fcb49cbfa76a3 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 27 Feb 2010 00:27:49 +0000 Subject: [PATCH] Return false in new_try handlers in proxy.lua, so that socket errors are reported to the caller like other errors are. --- nselib/proxy.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nselib/proxy.lua b/nselib/proxy.lua index ed714b74a..335f32d44 100644 --- a/nselib/proxy.lua +++ b/nselib/proxy.lua @@ -171,7 +171,7 @@ end function connectProxy(host, port, proxyType, hostname) local socket = nmap.new_socket() socket:set_timeout(10000) - local try = nmap.new_try(function() socket:close() end) + local try = nmap.new_try(function() socket:close() return false end) try(socket:connect(host.ip, port.number)) if proxyType == "http" then return socket end if proxyType == "socks4" then return socksHandshake(socket, 4, hostname) end @@ -187,7 +187,7 @@ end function socksHandshake(socket, version, hostname) local resolve, sip, paystring, payload resolve, sip = hex_resolve(hostname) - local try = nmap.new_try(function() socket:close() end) + local try = nmap.new_try(function() socket:close() return false end) if not resolve then stdnse.print_debug("Unable to resolve hostname.") return false