@@ -127,6 +127,7 @@ struct settings { | |||||
gc=v.get("session.gc",10); | gc=v.get("session.gc",10); | ||||
std::string stor = v.get("session.storage",""); | std::string stor = v.get("session.storage",""); | ||||
if(!stor.empty()) { | if(!stor.empty()) { | ||||
#ifndef CPPCMS_NO_GZIP | |||||
if(stor == "files") { | if(stor == "files") { | ||||
std::string dir = v.get("session.dir",""); | std::string dir = v.get("session.dir",""); | ||||
#ifdef CPPCMS_WIN_NATIVE | #ifdef CPPCMS_WIN_NATIVE | ||||
@@ -135,7 +136,9 @@ struct settings { | |||||
sessions.reset(new cppcms::sessions::session_file_storage_factory(dir,threads,1,false)); | sessions.reset(new cppcms::sessions::session_file_storage_factory(dir,threads,1,false)); | ||||
#endif | #endif | ||||
} | } | ||||
else if(stor == "memory") { | |||||
else | |||||
#endif //CPPCMS_NO_GZIP | |||||
if(stor == "memory") { | |||||
sessions.reset(new cppcms::sessions::session_memory_storage_factory()); | sessions.reset(new cppcms::sessions::session_memory_storage_factory()); | ||||
} | } | ||||
else if(stor == "external") { | else if(stor == "external") { | ||||
@@ -230,6 +230,7 @@ void session_pool::init() | |||||
if((location == "server" || location == "both") && !storage_.get()) { | if((location == "server" || location == "both") && !storage_.get()) { | ||||
std::string stor=settings.get<std::string>("session.server.storage"); | std::string stor=settings.get<std::string>("session.server.storage"); | ||||
std::auto_ptr<sessions::session_storage_factory> factory; | std::auto_ptr<sessions::session_storage_factory> factory; | ||||
#ifndef CPPCMS_NO_GZIP | |||||
if(stor == "files") { | if(stor == "files") { | ||||
std::string dir = settings.get("session.server.dir",""); | std::string dir = settings.get("session.server.dir",""); | ||||
#ifdef CPPCMS_WIN_NATIVE | #ifdef CPPCMS_WIN_NATIVE | ||||
@@ -251,7 +252,9 @@ void session_pool::init() | |||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
else if(stor == "memory") { | |||||
else | |||||
#endif// CPPCMS_NO_GZIP | |||||
if(stor == "memory") { | |||||
if(!service_) { | if(!service_) { | ||||
throw cppcms_error("Can't use memory storage for external session management"); | throw cppcms_error("Can't use memory storage for external session management"); | ||||
} | } | ||||
@@ -133,6 +133,7 @@ int main() | |||||
storage=mem.get(); | storage=mem.get(); | ||||
test(storage,mem); | test(storage,mem); | ||||
std::cout << "Testing file storage" << std::endl; | std::cout << "Testing file storage" << std::endl; | ||||
#ifndef CPPCMS_NO_GZIP | |||||
#ifndef CPPCMS_WIN_NATIVE | #ifndef CPPCMS_WIN_NATIVE | ||||
std::cout << "Testing single process" << std::endl; | std::cout << "Testing single process" << std::endl; | ||||
session_file_storage_factory f1(dir,5,1,false); | session_file_storage_factory f1(dir,5,1,false); | ||||
@@ -151,6 +152,7 @@ int main() | |||||
storage=f.get(); | storage=f.get(); | ||||
test_files(storage,f); | test_files(storage,f); | ||||
#endif | #endif | ||||
#endif | |||||
#ifndef CPPCMS_NO_TCP_CACHE | #ifndef CPPCMS_NO_TCP_CACHE | ||||
std::cout << "Testing network backend" << std::endl; | std::cout << "Testing network backend" << std::endl; | ||||