From d727acca33d08a2f7be305ea457323413c715919 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Wed, 19 Mar 2014 06:40:36 -0700 Subject: [PATCH] Increases the loglevel while failed to delete a collection One of the reasons that sdbm failed to delete a key is the fact that it may already been excluded). The error logs are not clear regarding that. Check if the key exists prior to delete will generate unecessary computation. This commit increases the loglevel of the error message and makes it acts like the operation was successfully accomplished. --- apache2/persist_dbm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apache2/persist_dbm.c b/apache2/persist_dbm.c index b698e791..d059e982 100644 --- a/apache2/persist_dbm.c +++ b/apache2/persist_dbm.c @@ -217,14 +217,13 @@ static apr_table_t *collection_retrieve_ex(apr_sdbm_t *existing_dbm, modsec_rec rc = apr_sdbm_delete(dbm, key); if (rc != APR_SUCCESS) { - msr_log(msr, 1, "collection_retrieve_ex: Failed deleting collection (name \"%s\", " - "key \"%s\"): %s", log_escape(msr->mp, col_name), + msr_log(msr, 9, "collection_retrieve_ex: Failed deleting collection (name \"%s\", " + "key \"%s\"): %s (It may already have been excluded).", log_escape(msr->mp, col_name), log_escape_ex(msr->mp, col_key, col_key_len), get_apr_error(msr->mp, rc)); msr->msc_sdbm_delete_error = 1; - goto cleanup; + /*goto cleanup;*/ } - if (existing_dbm == NULL) { apr_sdbm_close(dbm); dbm = NULL;