summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/configuration.cc1
-rw-r--r--server/src/configuration.h1
-rw-r--r--server/src/configurationparser.cc6
-rw-r--r--server/src/session.cc7
4 files changed, 15 insertions, 0 deletions
diff --git a/server/src/configuration.cc b/server/src/configuration.cc
index b222639..65eeae6 100644
--- a/server/src/configuration.cc
+++ b/server/src/configuration.cc
@@ -61,3 +61,4 @@ int Conf::connection_limit = 42;
int Conf::connection_timeout = 0;
std::string Conf::session_path = "/tmp";
+std::string Conf::session_discard_path = "";
diff --git a/server/src/configuration.h b/server/src/configuration.h
index b6adadc..bf05572 100644
--- a/server/src/configuration.h
+++ b/server/src/configuration.h
@@ -69,6 +69,7 @@ namespace Conf {
extern int connection_timeout;
extern std::string session_path;
+ extern std::string session_discard_path;
};
#endif/*__ARTEFACT_CONFIGURATION_H__*/
diff --git a/server/src/configurationparser.cc b/server/src/configurationparser.cc
index 0796cb9..ca78c84 100644
--- a/server/src/configurationparser.cc
+++ b/server/src/configurationparser.cc
@@ -195,6 +195,12 @@ void ConfigurationParser::reload()
Conf::session_path = s;
} catch( ... ) {
}
+
+ try {
+ std::string s = lookup("session_discard_path");
+ Conf::session_discard_path = s;
+ } catch( ... ) {
+ }
}
#ifdef TEST_CONFIGURATIONPARSER
diff --git a/server/src/session.cc b/server/src/session.cc
index e236416..8071d45 100644
--- a/server/src/session.cc
+++ b/server/src/session.cc
@@ -152,10 +152,17 @@ void Session::discard()
{
DEBUG(session, "[%p] discard(sessionid: '%s')\n", this, sessionid.c_str());
+ // Store session file in discarded folder before deleting.
+ if(isreadonly == false && Conf::session_discard_path != "") {
+ SessionSerialiser ser(env, Conf::session_discard_path);
+ ser.save(this);
+ }
+
if(_journal) {
delete _journal;
_journal = NULL;
}
+
if(isreadonly == false) {
AutoBorrower<Database*> borrower(env->dbpool);
Database *db = borrower.get();