Commit bae1eedf authored by jan.koester's avatar jan.koester
Browse files

test

parent b82c25c1
Loading
Loading
Loading
Loading
Loading
+0 −17
Changes for src/session.cpp: 0 added lines, 17 removed lines.
Original line number Diff line number Diff line
@@ -423,23 +423,6 @@ const authdb::SessionData *authdb::Session::getSession(uuid::uuid sessionid){
        cleanupExpired();
        for(SessionData *cur=_firstData; cur; cur=cur->_next){
            if(cur->_sid==sessionid){
                // Validate session still exists in cluster (may have been removed on another node)
                if (g_Cluster && g_Cluster->isRunning()) {
                    if (!g_Cluster->hasSessionBySid(sessionid)) {
                        // Session was removed on another node — purge local cache
                        SessionData *prev = nullptr;
                        for (SessionData *p = _firstData; p; p = p->_next) {
                            if (p == cur) break;
                            prev = p;
                        }
                        if (prev) prev->_next = cur->_next;
                        if (cur == _firstData) _firstData = cur->_next;
                        if (cur == _lastData) _lastData = prev;
                        cur->_next = nullptr;
                        delete cur;
                        return nullptr;
                    }
                }
                return cur;
            }
        }