mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
Move locking before table update
This commit is contained in:
committed by
Felipe Zimmerle
parent
84d2f30cc8
commit
c6f6dffed2
@@ -384,6 +384,14 @@ int collection_store(modsec_rec *msr, apr_table_t *col) {
|
|||||||
log_escape(msr->mp, dbm_filename));
|
log_escape(msr->mp, dbm_filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Need to lock to pull in the stored data again and apply deltas. */
|
||||||
|
rc = apr_global_mutex_lock(msr->modsecurity->dbm_lock);
|
||||||
|
if (rc != APR_SUCCESS) {
|
||||||
|
msr_log(msr, 1, "collection_store: Failed to lock proc mutex: %s",
|
||||||
|
get_apr_error(msr->mp, rc));
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
/* Delete IS_NEW on store. */
|
/* Delete IS_NEW on store. */
|
||||||
apr_table_unset(col, "IS_NEW");
|
apr_table_unset(col, "IS_NEW");
|
||||||
|
|
||||||
@@ -432,14 +440,6 @@ int collection_store(modsec_rec *msr, apr_table_t *col) {
|
|||||||
var->value_len = strlen(var->value);
|
var->value_len = strlen(var->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Need to lock to pull in the stored data again and apply deltas. */
|
|
||||||
rc = apr_global_mutex_lock(msr->modsecurity->dbm_lock);
|
|
||||||
if (rc != APR_SUCCESS) {
|
|
||||||
msr_log(msr, 1, "collection_store: Failed to lock proc mutex: %s",
|
|
||||||
get_apr_error(msr->mp, rc));
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ENH Make the expiration timestamp accessible in blob form so that
|
/* ENH Make the expiration timestamp accessible in blob form so that
|
||||||
* it is easier/faster to determine expiration without having to
|
* it is easier/faster to determine expiration without having to
|
||||||
* convert back to table form
|
* convert back to table form
|
||||||
|
Reference in New Issue
Block a user