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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user