From a6fe7c75aa64477974b7f2c9f36585cd3a70d7bb Mon Sep 17 00:00:00 2001 From: kroosec Date: Mon, 25 Jun 2012 00:55:52 +0000 Subject: [PATCH] Fixed documentation and return values for options sip request. --- nselib/sip.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/nselib/sip.lua b/nselib/sip.lua index e539ca5e7..9cefaa261 100644 --- a/nselib/sip.lua +++ b/nselib/sip.lua @@ -326,8 +326,7 @@ Session = { --- Sends an option request to the server and handles the response -- @return status true on success, false on failure - -- @return response if status is true, msg string containing the error - -- message if status is false + -- @return response if status is true, nil else. options = function(self) local req = Request:new(Method.OPTIONS) req:setUri("sip:" .. self.sessdata:getServer()) @@ -336,12 +335,9 @@ Session = { req:addHeader("Accept", "application/sdp") local status, response = self:exch(req) - if (status) then return true, response end + if status then return true, response end - local errcode = response:getErrorCode() - local errmsg = response:getErrorMessage() - local msg = ( errcode and ( errcode .. " " .. errmsg ) ) - return ( not(errcode) or errcode == 200), msg + return false, nil end, }