mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 21:19:01 +00:00
Fixed documentation and return values for options sip request.
This commit is contained in:
@@ -326,8 +326,7 @@ Session = {
|
|||||||
|
|
||||||
--- Sends an option request to the server and handles the response
|
--- Sends an option request to the server and handles the response
|
||||||
-- @return status true on success, false on failure
|
-- @return status true on success, false on failure
|
||||||
-- @return response if status is true, msg string containing the error
|
-- @return response if status is true, nil else.
|
||||||
-- message if status is false
|
|
||||||
options = function(self)
|
options = function(self)
|
||||||
local req = Request:new(Method.OPTIONS)
|
local req = Request:new(Method.OPTIONS)
|
||||||
req:setUri("sip:" .. self.sessdata:getServer())
|
req:setUri("sip:" .. self.sessdata:getServer())
|
||||||
@@ -336,12 +335,9 @@ Session = {
|
|||||||
req:addHeader("Accept", "application/sdp")
|
req:addHeader("Accept", "application/sdp")
|
||||||
|
|
||||||
local status, response = self:exch(req)
|
local status, response = self:exch(req)
|
||||||
if (status) then return true, response end
|
if status then return true, response end
|
||||||
|
|
||||||
local errcode = response:getErrorCode()
|
return false, nil
|
||||||
local errmsg = response:getErrorMessage()
|
|
||||||
local msg = ( errcode and ( errcode .. " " .. errmsg ) )
|
|
||||||
return ( not(errcode) or errcode == 200), msg
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user