Browse Source

Fixed #36 - failing to build with disabled gzip

master
Artyom Beilis 6 years ago
parent
commit
68faec5da3
3 changed files with 10 additions and 2 deletions
  1. +4
    -1
      src/cache_server_main.cpp
  2. +4
    -1
      src/session_pool.cpp
  3. +2
    -0
      tests/storage_test.cpp

+ 4
- 1
src/cache_server_main.cpp View File

@@ -127,6 +127,7 @@ struct settings {
gc=v.get("session.gc",10);
std::string stor = v.get("session.storage","");
if(!stor.empty()) {
#ifndef CPPCMS_NO_GZIP
if(stor == "files") {
std::string dir = v.get("session.dir","");
#ifdef CPPCMS_WIN_NATIVE
@@ -135,7 +136,9 @@ struct settings {
sessions.reset(new cppcms::sessions::session_file_storage_factory(dir,threads,1,false));
#endif
}
else if(stor == "memory") {
else
#endif //CPPCMS_NO_GZIP
if(stor == "memory") {
sessions.reset(new cppcms::sessions::session_memory_storage_factory());
}
else if(stor == "external") {


+ 4
- 1
src/session_pool.cpp View File

@@ -230,6 +230,7 @@ void session_pool::init()
if((location == "server" || location == "both") && !storage_.get()) {
std::string stor=settings.get<std::string>("session.server.storage");
std::auto_ptr<sessions::session_storage_factory> factory;
#ifndef CPPCMS_NO_GZIP
if(stor == "files") {
std::string dir = settings.get("session.server.dir","");
#ifdef CPPCMS_WIN_NATIVE
@@ -251,7 +252,9 @@ void session_pool::init()
}
#endif
}
else if(stor == "memory") {
else
#endif// CPPCMS_NO_GZIP
if(stor == "memory") {
if(!service_) {
throw cppcms_error("Can't use memory storage for external session management");
}


+ 2
- 0
tests/storage_test.cpp View File

@@ -133,6 +133,7 @@ int main()
storage=mem.get();
test(storage,mem);
std::cout << "Testing file storage" << std::endl;
#ifndef CPPCMS_NO_GZIP
#ifndef CPPCMS_WIN_NATIVE
std::cout << "Testing single process" << std::endl;
session_file_storage_factory f1(dir,5,1,false);
@@ -151,6 +152,7 @@ int main()
storage=f.get();
test_files(storage,f);
#endif
#endif
#ifndef CPPCMS_NO_TCP_CACHE
std::cout << "Testing network backend" << std::endl;


Loading…
Cancel
Save