removed some thread and ticket information from request
they are in FunThread and FunTicket classes now added funtion FunUptime (I forgot about it) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@631 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -45,13 +45,13 @@ void SessionManager::SetSystem(System * psystem)
|
||||
|
||||
void SessionManager::SetLastContainer(LastContainer * plast_container)
|
||||
{
|
||||
session_table.SetLastContainer(plast_container);
|
||||
session_tab.SetLastContainer(plast_container);
|
||||
}
|
||||
|
||||
|
||||
bool SessionManager::IsSession(long id)
|
||||
{
|
||||
if( session_table.FindById(id) == session_table.End() )
|
||||
if( session_tab.FindById(id) == session_tab.End() )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -92,15 +92,15 @@ return id;
|
||||
|
||||
void SessionManager::CreateTemporarySession()
|
||||
{
|
||||
SessionContainer::Iterator i = session_table.FindById( 0 );
|
||||
SessionContainer::Iterator i = session_tab.FindById( 0 );
|
||||
|
||||
if( i == session_table.End() )
|
||||
if( i == session_tab.End() )
|
||||
{
|
||||
Session s;
|
||||
s.id = 0;
|
||||
|
||||
session_table.PushBack(s);
|
||||
request->session = &session_table.Back();
|
||||
session_tab.PushBack(s);
|
||||
request->session = &session_tab.Back();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -119,11 +119,11 @@ int attempts = 100;
|
||||
{
|
||||
s.id = CreateSessionId();
|
||||
|
||||
bool added = session_table.PushBack(s);
|
||||
bool added = session_tab.PushBack(s);
|
||||
|
||||
if( added )
|
||||
{
|
||||
request->session = &session_table.Back();
|
||||
request->session = &session_tab.Back();
|
||||
request->session->new_session = true;
|
||||
|
||||
log << log2 << "SM: created a new session: " << request->session->id << logend;
|
||||
@@ -144,15 +144,15 @@ int attempts = 100;
|
||||
bool SessionManager::SetSessionFromCookie(const std::string & cookie)
|
||||
{
|
||||
long id = atol(cookie.c_str());
|
||||
SessionContainer::Iterator s = session_table.FindById(id);
|
||||
SessionContainer::Iterator s = session_tab.FindById(id);
|
||||
|
||||
if( s == session_table.End() )
|
||||
if( s == session_tab.End() )
|
||||
return false;
|
||||
|
||||
// that session is in the table
|
||||
request->session = &(*s);
|
||||
request->session->new_session = false;
|
||||
session_table.UpdateLastTime(s, std::time(0));
|
||||
session_tab.UpdateLastTime(s, std::time(0));
|
||||
|
||||
if( request->method == Request::get )
|
||||
request->session->last_time_get = request->session->last_time;
|
||||
@@ -171,9 +171,9 @@ return true;
|
||||
|
||||
void SessionManager::SetSession()
|
||||
{
|
||||
CookieTable::iterator i = request->cookie_table.find(config->http_session_id_name);
|
||||
CookieTab::iterator i = request->cookie_tab.find(config->http_session_id_name);
|
||||
|
||||
if( i == request->cookie_table.end() )
|
||||
if( i == request->cookie_tab.end() )
|
||||
{
|
||||
CreateSession();
|
||||
}
|
||||
@@ -183,7 +183,7 @@ void SessionManager::SetSession()
|
||||
{
|
||||
// there is no such a session
|
||||
// deleting the old cookie
|
||||
request->cookie_table.erase(i);
|
||||
request->cookie_tab.erase(i);
|
||||
|
||||
// and creating a new one
|
||||
CreateSession();
|
||||
@@ -205,14 +205,14 @@ void SessionManager::SetSession()
|
||||
|
||||
SessionContainer::Iterator SessionManager::SessionBegin()
|
||||
{
|
||||
return session_table.Begin();
|
||||
return session_tab.Begin();
|
||||
}
|
||||
|
||||
|
||||
|
||||
SessionContainer::Iterator SessionManager::SessionEnd()
|
||||
{
|
||||
return session_table.End();
|
||||
return session_tab.End();
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ SessionContainer::Iterator SessionManager::SessionEnd()
|
||||
|
||||
void SessionManager::DeleteOldSessions()
|
||||
{
|
||||
session_table.DelFirstByTimeInterval(config->session_max_idle);
|
||||
session_tab.DelFirstByTimeInterval(config->session_max_idle);
|
||||
|
||||
if( ++session_checker > 1000 )
|
||||
{
|
||||
@@ -228,7 +228,7 @@ void SessionManager::DeleteOldSessions()
|
||||
log << log3 << "SM: checking sessions which have 'remember me' flag set" << logend;
|
||||
|
||||
session_checker = 0;
|
||||
session_table.DelFirstByTimeInterval(config->session_remember_max_idle, false);
|
||||
session_tab.DelFirstByTimeInterval(config->session_remember_max_idle, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,11 +236,11 @@ void SessionManager::DeleteOldSessions()
|
||||
|
||||
void SessionManager::DeleteAllPluginsData()
|
||||
{
|
||||
SessionContainer::Iterator i = session_table.Begin();
|
||||
SessionContainer::Iterator i = session_tab.Begin();
|
||||
|
||||
Session * old_session = request->session;
|
||||
|
||||
for( ; i!=session_table.End() ; ++i )
|
||||
for( ; i!=session_tab.End() ; ++i )
|
||||
{
|
||||
request->session = &(*i);
|
||||
i->plugin_data.DeleteAll();
|
||||
@@ -261,10 +261,10 @@ SessionContainer::Iterator i;
|
||||
sp.SetUsers(&system->users);
|
||||
Session * old_session = request->session;
|
||||
|
||||
sp.Parse(config->session_file, session_table);
|
||||
i = session_table.Begin();
|
||||
sp.Parse(config->session_file, session_tab);
|
||||
i = session_tab.Begin();
|
||||
|
||||
for( ; i!=session_table.End() ; ++i )
|
||||
for( ; i!=session_tab.End() ; ++i )
|
||||
{
|
||||
i->plugin_data.Resize(plugin.Size());
|
||||
request->session = &(*i);
|
||||
@@ -294,9 +294,9 @@ void SessionManager::SaveSessions()
|
||||
log << log2 << "SM: saving sessions" << logend;
|
||||
long len = 0;
|
||||
|
||||
SessionContainer::Iterator i = session_table.Begin();
|
||||
SessionContainer::Iterator i = session_tab.Begin();
|
||||
|
||||
for( ; i!=session_table.End() ; ++i )
|
||||
for( ; i!=session_tab.End() ; ++i )
|
||||
{
|
||||
if( i->id != 0 && i->puser )
|
||||
{
|
||||
|
Reference in New Issue
Block a user