mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
MODSEC-160
This commit is contained in:
@@ -212,28 +212,30 @@ static void modsecurity_persist_data(modsec_rec *msr) {
|
||||
}
|
||||
|
||||
time_after = apr_time_now();
|
||||
|
||||
|
||||
msr->time_storage_write += time_after - time_before;
|
||||
|
||||
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
msr_log(msr, 4, "Recording persistent data took %" APR_TIME_T_FMT
|
||||
" microseconds.", msr->time_gc);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Remove stale collections. */
|
||||
srand(time(NULL));
|
||||
|
||||
if (rand() < RAND_MAX/100) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
msr->time_gc = apr_time_now() - time_after;
|
||||
|
||||
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
msr_log(msr, 4, "Garbage collection took %" APR_TIME_T_FMT
|
||||
" microseconds.", msr->time_gc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user