mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Remove unused socket connect/close from ipp.Helper. Close #3245
This commit is contained in:
parent
fd94457aeb
commit
ce0c08997e
3 changed files with 6 additions and 27 deletions
|
|
@ -1,7 +1,6 @@
|
|||
local ipp = require "ipp"
|
||||
local shortport = require "shortport"
|
||||
local stdnse = require "stdnse"
|
||||
local string = require "string"
|
||||
local table = require "table"
|
||||
|
||||
description = [[
|
||||
|
|
@ -51,13 +50,8 @@ local verbose_states = {
|
|||
|
||||
action = function(host, port)
|
||||
|
||||
local helper = ipp.Helper:new(host, port)
|
||||
if ( not(helper:connect()) ) then
|
||||
return stdnse.format_output(false, "Failed to connect to server")
|
||||
end
|
||||
|
||||
local status, printers = helper:getPrinters()
|
||||
if ( not(status) ) then
|
||||
local status, printers = ipp.Helper:new(host, port):getPrinters()
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -35,13 +35,8 @@ categories = {"safe", "discovery"}
|
|||
portrule = shortport.port_or_service(631, "ipp", "tcp", "open")
|
||||
|
||||
action = function(host, port)
|
||||
local helper = ipp.Helper:new(host, port)
|
||||
if ( not(helper:connect()) ) then
|
||||
return stdnse.format_output(false, "Failed to connect to server")
|
||||
end
|
||||
|
||||
local output = helper:getQueueInfo()
|
||||
if ( output ) then
|
||||
local output = ipp.Helper:new(host, port):getQueueInfo()
|
||||
if output then
|
||||
return stdnse.format_output(true, output)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue