Remove unused socket connect/close from ipp.Helper. Close #3245

This commit is contained in:
nnposter 2026-01-01 22:34:15 +00:00
parent fd94457aeb
commit ce0c08997e
3 changed files with 6 additions and 27 deletions

View file

@ -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

View file

@ -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