1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-02 19:49:11 +00:00

Let imap and pop3 use shorter connect timeouts

This commit is contained in:
dmiller
2014-09-19 03:10:10 +00:00
parent 45ff211483
commit 791566faf0
2 changed files with 2 additions and 5 deletions

View File

@@ -93,9 +93,7 @@ IMAP = {
-- @return status true on success, false on failure
-- @return banner string containing the server banner
connect = function(self)
local socket, banner, opt = comm.tryssl( self.host, self.port, "", { recv_before = true } )
if ( not(socket) ) then return false, "ERROR: Failed to connect to server" end
socket:set_timeout(self.timeout)
local socket, banner, opt = comm.tryssl( self.host, self.port, "", { request_timeout=self.timeout, recv_before=true } )
if ( not(socket) or not(banner) ) then return false, "ERROR: Failed to connect to server" end
self.socket = socket
return true, banner

View File

@@ -5,7 +5,6 @@
local base64 = require "base64"
local comm = require "comm"
local nmap = require "nmap"
local stdnse = require "stdnse"
local string = require "string"
local table = require "table"
@@ -146,7 +145,7 @@ end
-- @return nil or String error message.
function capabilities(host, port)
local socket, line, bopt, first_line = comm.tryssl(host, port, "" , {timeout=10000, recv_before=true})
local socket, line, bopt, first_line = comm.tryssl(host, port, "" , {request_timeout=10000, recv_before=true})
if not socket then
return nil, "Could Not Connect"
end