MODSEC-160

This commit is contained in:
brenosilva
2011-10-14 13:32:30 +00:00
parent 1bf5f4532e
commit d4079971c6
5 changed files with 54 additions and 11 deletions

View File

@@ -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);
}
}
}
}