diff --git a/nselib/httpspider.lua b/nselib/httpspider.lua index a2b219b94..3dee86f56 100644 --- a/nselib/httpspider.lua +++ b/nselib/httpspider.lua @@ -542,9 +542,10 @@ UrlQueue = { end, -- dumps the contents of the UrlQueue - dump = function(self) + dump = function(self, printer) + printer = printer or print for _, url in ipairs(self.urls) do - print("url:", url) + printer("url:", url) end end, diff --git a/nselib/iax2.lua b/nselib/iax2.lua index 05c6b815e..cb6a9ad83 100644 --- a/nselib/iax2.lua +++ b/nselib/iax2.lua @@ -74,8 +74,7 @@ IAX2 = { local header = IAX2.Header:new() local frame_type, pos = string.unpack("B", data) if ( (frame_type & 0x80) == 0 ) then - print("frame_type", stdnse.tohex(frame_type)) - stdnse.debug2("Frametype not supported") + stdnse.debug2("Frametype %x not supported", frame_type) return end header.type = IAX2.PacketType.FULL diff --git a/nselib/packet.lua b/nselib/packet.lua index c01e3ea16..24a36e717 100644 --- a/nselib/packet.lua +++ b/nselib/packet.lua @@ -563,13 +563,13 @@ end function Packet:ip_parse(force_continue) self.ip_offset = 0 if #self.buf < 20 then -- too short - print("too short") + stdnse.debug2("Packet.ip_parse: too short") return false end self.ip_v = (self:u8(self.ip_offset + 0) & 0xF0) >> 4 self.ip_hl = (self:u8(self.ip_offset + 0) & 0x0F) -- header_length or data_offset if self.ip_v ~= 4 then -- not ip - print("not v4") + stdnse.debug2("Packet.ip_parse: Not IPv4") return false end self.ip = true