Move from session based state to client side tokens.

YACReaderHttpSession is still used, but it is not a http session anymore.
This commit is contained in:
Luis Ángel San Martín
2018-04-25 22:20:03 +02:00
parent 701817d76b
commit 630a5c94a0
9 changed files with 75 additions and 46 deletions

View File

@ -8,9 +8,11 @@
YACReaderHttpSessionStore::YACReaderHttpSessionStore(HttpSessionStore *sessionStore, QObject *parent)
: QObject(parent), sessionStore(sessionStore)
{
connect(&cleanupTimer,SIGNAL(timeout()),this,SLOT(sessionTimerEvent()));
cleanupTimer.start(60000);
{
//sessions are no longer http sessions in v2, we need another mechanism for cleaning
//connect(&cleanupTimer,SIGNAL(timeout()),this,SLOT(sessionTimerEvent()));
//cleanupTimer.start(60000);
}
void YACReaderHttpSessionStore::addYACReaderHttpSession(const QByteArray &httpSessionId, YACReaderHttpSession *yacreaderHttpSession)
@ -28,8 +30,9 @@ YACReaderHttpSession *YACReaderHttpSessionStore::getYACReaderSessionHttpSession(
}
void YACReaderHttpSessionStore::sessionTimerEvent()
{
QMutexLocker locker(&mutex);
{
//sessions are no longer http sessions in v2, we are using a token, so sessionStore->getSession(id).isNull() is always true.
/*QMutexLocker locker(&mutex);
for(const QByteArray &id : sessions.keys())
{
if(sessionStore->getSession(id).isNull())
@ -40,5 +43,5 @@ void YACReaderHttpSessionStore::sessionTimerEvent()
sessions.remove(id);
}
}
}*/
}