Commit 4cd21f8e authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed edge case where session counter might go wrong.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5135 b35dd754-fafc-0310-a699-88a17e54d16e
parent ca175690
......@@ -1401,7 +1401,12 @@ public class SessionManager extends BasicModule {
offline.setType(Presence.Type.unavailable);
router.route(offline);
}
return auth_removed || preauth_removed;
if (auth_removed || preauth_removed) {
// Decrement the counter of user sessions
usersSessionsCounter.decrementAndGet();
return true;
}
return false;
}
public void addAnonymousSession(ClientSession session) {
......@@ -1455,10 +1460,7 @@ public class SessionManager extends BasicModule {
}
finally {
// Remove the session
if (removeSession(session)) {
// Decrement the counter of user sessions
usersSessionsCounter.decrementAndGet();
}
removeSession(session);
}
}
catch (Exception e) {
......
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