diff --git a/nselib/comm.lua b/nselib/comm.lua index 495cd47d1..10f0d2d96 100644 --- a/nselib/comm.lua +++ b/nselib/comm.lua @@ -4,16 +4,18 @@ -- The functions in this module return values appropriate for use with -- exception handling via nmap.new_try(). -- --- These functions may be passed a table of options, but it's not --- required. The keys for the options table are "bytes", "lines", --- "proto", and "timeout". "bytes" sets a minimum number of bytes to --- read. "lines" does the same for lines. "proto" sets the protocol to --- communicate with, defaulting to "tcp" if not provided. "timeout" sets --- the socket timeout (see the socket function --- set_timeout() for details). +-- These functions may be passed a table of options, but it's not required. The +-- keys for the options table are "bytes", "lines", +-- "proto", and "timeout". "bytes" sets +-- a minimum number of bytes to read. "lines" does the same for +-- lines. "proto" sets the protocol to communicate with, +-- defaulting to "tcp" if not provided. "timeout" +-- sets the socket timeout (see the socket function set_timeout() +-- for details). -- --- If both "bytes" and "lines" are provided, "lines" takes precedence. --- If neither are given, the functions read as many bytes as possible. +-- If both "bytes" and "lines" are provided, +-- "lines" takes precedence. If neither are given, the functions +-- read as many bytes as possible. -- @author Kris Katterjohn 04/2008 -- @copyright Same as Nmap--See http://nmap.org/book/man-legal.html diff --git a/nselib/stdnse.lua b/nselib/stdnse.lua index a7d26ba4e..a97271b94 100644 --- a/nselib/stdnse.lua +++ b/nselib/stdnse.lua @@ -86,10 +86,11 @@ end -- does not include the separator. It will return the final data even if it is -- not followed by the separator. Once an error or EOF is reached, it returns -- nil, msg. msg is what is returned by --- nmap.receive_lines(). +-- nmap.receive_lines. -- @param socket Socket for the buffer. -- @param sep Separator for the buffered reads. --- @return Data from socket reads. +-- @return Data from socket reads or nil on EOF or error. +-- @return Error message, as with receive_lines(). function make_buffer(socket, sep) local point, left, buffer, done, msg = 1, ""; local function self()