Adds support to collection using memcache.

This is the initial support to collections using memcache.
This commit is contained in:
Felipe Zimmerle
2014-03-17 12:58:35 -07:00
parent 39caeedf14
commit 0318b10461
19 changed files with 731 additions and 98 deletions

View File

@@ -18,11 +18,13 @@
#include "modsecurity.h"
#include "msc_parsers.h"
#include "msc_persistent_memcache.h"
#include "msc_util.h"
#include "msc_json.h"
#include "msc_xml.h"
#include "apr_version.h"
unsigned long int DSOLOCAL unicode_codepage = 0;
int DSOLOCAL *unicode_map_table = NULL;
@@ -209,7 +211,13 @@ static void modsecurity_persist_data(modsec_rec *msr) {
/* Only store those collections that changed. */
if (apr_table_get(msr->collections_dirty, te[i].key)) {
collection_store(msr, col);
if (msr->dcfg1->persistent_storage != STORAGE_TYPE_MEMCACHE) {
collection_store(msr, col);
} else
{
msc_memcache_collection_store(msr, col);
}
}
}
@@ -229,7 +237,9 @@ static void modsecurity_persist_data(modsec_rec *msr) {
arr = apr_table_elts(msr->collections);
te = (apr_table_entry_t *)arr->elts;
for (i = 0; i < arr->nelts; i++) {
collections_remove_stale(msr, te[i].key);
if (msr->dcfg1->persistent_storage != STORAGE_TYPE_MEMCACHE) {
collections_remove_stale(msr, te[i].key);
}
}
msr->time_gc = apr_time_now() - time_after;