Commit 3b726812 authored by Renato Figueiro Maia's avatar Renato Figueiro Maia

[OPENBUS-2591] [Lua] Método logout() do SDK não deve chamar a callback onInvalidLogin

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/sdk/lua/branches/02_00_00@158001 ae0415b3-e90b-0410-900d-d0be9363c56b
parent a14f6c70
......@@ -579,18 +579,21 @@ function Connection:loginBySharedAuth(attempt, secret)
end
function Connection:logout()
local result, except = false
local login = self.login
if login ~= nil then
log:request(msg.PerformLogout:tag{
login = login.id,
entity = login.entity,
})
local result, except = pcallWithin(self, self.AccessControl, "logout")
local thread = running()
InvalidLoginThreads[thread] = true
result, except = pcallWithin(self, self.AccessControl, "logout")
InvalidLoginThreads[thread] = nil
localLogout(self)
return result, except
end
self.invalidLogin = nil
return false
return result, except
end
function Connection:onInvalidLogin()
......
......@@ -347,6 +347,13 @@ for _, connOp in ipairs({"DefaultConnection", "CurrentConnection"}) do
assert(called); called = nil
assertlogoff(conn)
relogin()
-- during logout
assert(called == nil)
invalidate(conn.login.id)
assert(conn:logout() == false)
assert(called == nil)
assertlogoff(conn)
relogin()
end
do log:TEST "reconnect"
......@@ -368,6 +375,13 @@ for _, connOp in ipairs({"DefaultConnection", "CurrentConnection"}) do
invalidate(conn.login.id)
callwithin(conn, OfferRegistry.findServices, OfferRegistry, {})
assert(called); called = nil
-- during logout
assert(called == nil)
invalidate(conn.login.id)
assert(conn:logout() == false)
assert(called == nil)
assertlogoff(conn)
relogin()
end
do log:TEST "raise error"
......@@ -391,6 +405,14 @@ for _, connOp in ipairs({"DefaultConnection", "CurrentConnection"}) do
assert(ex.completed == "COMPLETED_NO")
assert(ex.minor == idl.const.services.access_control.NoLoginCode)
assert(called); called = nil
assertlogoff(conn)
relogin()
-- during logout
assert(called == nil)
invalidate(conn.login.id)
assert(conn:logout() == false)
assert(called == nil)
assertlogoff(conn)
end
log:TEST(false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment