@@ -36,7 +36,7 @@ namespace backend {
36
36
#ifdef WITH_LMDB
37
37
38
38
39
- LMDB::LMDB () : m_env(NULL ) {
39
+ LMDB::LMDB () : Collection( " " ), m_env(NULL ) {
40
40
mdb_env_create (&m_env);
41
41
mdb_env_open (m_env, " ./modsec-shared-collections" ,
42
42
MDB_WRITEMAP | MDB_NOSUBDIR, 0664 );
@@ -262,7 +262,7 @@ bool LMDB::storeOrUpdateFirst(const std::string &key,
262
262
263
263
264
264
void LMDB::resolveSingleMatch (const std::string& var,
265
- std::vector<const Variable *> *l) {
265
+ std::vector<const VariableValue *> *l) {
266
266
int rc;
267
267
MDB_txn *txn;
268
268
MDB_dbi dbi;
@@ -290,8 +290,7 @@ void LMDB::resolveSingleMatch(const std::string& var,
290
290
std::string *a = new std::string (
291
291
reinterpret_cast <char *>(mdb_value_ret.mv_data ),
292
292
mdb_value_ret.mv_size );
293
- Variable *v = new Variable (&var, a);
294
- v->m_dynamic_value = true ;
293
+ VariableValue *v = new VariableValue (&var, a);
295
294
l->push_back (v);
296
295
}
297
296
@@ -467,7 +466,7 @@ void LMDB::del(const std::string& key) {
467
466
468
467
469
468
void LMDB::resolveMultiMatches (const std::string& var,
470
- std::vector<const Variable *> *l) {
469
+ std::vector<const VariableValue *> *l) {
471
470
MDB_val key, data;
472
471
MDB_txn *txn = NULL ;
473
472
MDB_dbi dbi;
@@ -505,12 +504,11 @@ void LMDB::resolveMultiMatches(const std::string& var,
505
504
if (strncmp (var.c_str (), a, keySize) != 0 ) {
506
505
continue ;
507
506
}
508
- Variable *v = new Variable (
507
+ VariableValue *v = new VariableValue (
509
508
new std::string (reinterpret_cast <char *>(key.mv_data ),
510
509
key.mv_size ),
511
510
new std::string (reinterpret_cast <char *>(data.mv_data ),
512
511
data.mv_size ));
513
- v->m_dynamic_value = true ;
514
512
l->insert (l->begin (), v);
515
513
}
516
514
@@ -525,7 +523,7 @@ void LMDB::resolveMultiMatches(const std::string& var,
525
523
526
524
527
525
void LMDB::resolveRegularExpression (const std::string& var,
528
- std::vector<const Variable *> *l) {
526
+ std::vector<const VariableValue *> *l) {
529
527
MDB_val key, data;
530
528
MDB_txn *txn = NULL ;
531
529
MDB_dbi dbi;
@@ -599,12 +597,11 @@ void LMDB::resolveRegularExpression(const std::string& var,
599
597
continue ;
600
598
}
601
599
602
- Variable *v = new Variable (
600
+ VariableValue *v = new VariableValue (
603
601
new std::string (reinterpret_cast <char *>(key.mv_data ),
604
602
key.mv_size ),
605
603
new std::string (reinterpret_cast <char *>(data.mv_data ),
606
604
data.mv_size ));
607
- v->m_dynamic_value = true ;
608
605
l->insert (l->begin (), v);
609
606
}
610
607
0 commit comments