Makes LMDB support optional

This commit is contained in:
Felipe Zimmerle 2016-09-13 09:50:05 -03:00
parent 0a22f880dd
commit a1a1c71d6b
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
2 changed files with 7 additions and 0 deletions

View File

@ -33,6 +33,9 @@ namespace collection {
namespace backend { namespace backend {
#ifdef WITH_LMDB
LMDB::LMDB() : m_env(NULL) { LMDB::LMDB() : m_env(NULL) {
mdb_env_create(&m_env); mdb_env_create(&m_env);
mdb_env_open(m_env, "./modsec-shared-collections", mdb_env_open(m_env, "./modsec-shared-collections",
@ -646,6 +649,7 @@ end_txn:
return; return;
} }
#endif
} // namespace backend } // namespace backend
} // namespace collection } // namespace collection

View File

@ -36,6 +36,8 @@
#ifndef SRC_COLLECTION_BACKEND_LMDB_H_ #ifndef SRC_COLLECTION_BACKEND_LMDB_H_
#define SRC_COLLECTION_BACKEND_LMDB_H_ #define SRC_COLLECTION_BACKEND_LMDB_H_
#ifdef WITH_LMDB
#ifdef __cplusplus #ifdef __cplusplus
namespace modsecurity { namespace modsecurity {
namespace collection { namespace collection {
@ -78,5 +80,6 @@ class LMDB :
} // namespace modsecurity } // namespace modsecurity
#endif #endif
#endif // WITH_LMDB
#endif // SRC_COLLECTION_BACKEND_LMDB_H_ #endif // SRC_COLLECTION_BACKEND_LMDB_H_