1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 04:09:01 +00:00

Fix logic errors in comm.opencon when data is not supplied.

It looks like this code never worked, because the debug message was
using a nonexistent function (nsedebug.print_debug).
This commit is contained in:
david
2011-11-09 01:41:34 +00:00
parent 465594fa87
commit 7c64868741

View File

@@ -223,12 +223,12 @@ local function opencon(host, port, protocol, data, opts)
local response, early_resp;
if opts and opts.recv_before then status, early_resp = read(sd, opts) end
if #data > 0 then
if data and #data > 0 then
sd:send(data)
status, response = sd:receive()
else
if not opts and opts.recv_before then
nsedebug.print_debug("Using comm.tryssl without first data payload and recv_first." ..
if not (opts and opts.recv_before) then
stdnse.print_debug("Using comm.tryssl without first data payload and recv_first." ..
"\nImpossible to test the connection for the correct protocol!")
end
response = early_resp