Cleanup. See #364.

This commit is contained in:
brectanus
2008-07-29 05:47:14 +00:00
parent dde8e6c6a0
commit 40b6cd3ebe
7 changed files with 15 additions and 9 deletions

View File

@@ -538,7 +538,7 @@ void init_directory_config(directory_config *dcfg) {
if (dcfg->cache_trans_incremental == NOT_SET) dcfg->cache_trans_incremental = 0;
if (dcfg->cache_trans_min == (apr_size_t)NOT_SET) dcfg->cache_trans_min = 32;
if (dcfg->cache_trans_max == (apr_size_t)NOT_SET) dcfg->cache_trans_max = 1024;
if (dcfg->cache_trans_maxitems == (apr_size_t)NOT_SET) dcfg->cache_trans_maxitems = 1024;
if (dcfg->cache_trans_maxitems == (apr_size_t)NOT_SET) dcfg->cache_trans_maxitems = 512;
if (dcfg->request_encoding == NOT_SET_P) dcfg->request_encoding = NULL;
}

View File

@@ -314,7 +314,6 @@ apr_status_t modsecurity_tx_init(modsec_rec *msr) {
/* Other */
msr->tcache = NULL;
msr->tcache_items = 0;
msr->tcache_limit_warn = 0;
msr->matched_rules = apr_array_make(msr->mp, 16, sizeof(void *));
if (msr->matched_rules == NULL) return -1;

View File

@@ -366,7 +366,6 @@ struct modsec_rec {
/* data cache */
apr_hash_t *tcache;
apr_size_t tcache_items;
int tcache_limit_warn;
/* removed rules */
apr_array_header_t *removed_rules;

View File

@@ -2149,9 +2149,15 @@ static apr_status_t msre_rule_process_normal(msre_rule *rule, modsec_rec *msr) {
if ((msr->txcfg->cache_trans_maxitems != 0) &&
(msr->tcache_items >= msr->txcfg->cache_trans_maxitems))
{
msr_log(msr, 4, "CACHE: Disabled - maxitems=%" APR_SIZE_T_FMT
" limit reached.",
msr->txcfg->cache_trans_maxitems);
/* Warn only once if we attempt to go over the cache limit. */
if (msr->tcache_items == msr->txcfg->cache_trans_maxitems) {
msr->tcache_items++;
msr_log(msr, 4, "CACHE: Disabled - phase=%d"
" maxitems=%" APR_SIZE_T_FMT
" limit reached.",
msr->phase,
msr->txcfg->cache_trans_maxitems);
}
}
else if (msr->txcfg->cache_trans_incremental ||
(tfnsnum == tarr->nelts))

View File

@@ -166,8 +166,8 @@
SecRule ARGS "foobar" "phase:4,t:none,t:removeWhiteSpace,t:lowercase,deny"
),
match_log => {
debug => [ qr/Adding request argument \(BODY\): name "test", value "foobar"/, 15 ],
-error => [ qr/segmentation fault/i, 15 ],
debug => [ qr/Adding request argument \(BODY\): name "test", value "foobar"/, 60 ],
-error => [ qr/segmentation fault/i, 60 ],
},
match_response => {
status => qr/^403$/,

View File

@@ -23,6 +23,8 @@
ServerName localhost
CoreDumpDirectory @MSC_REGRESSION_SERVERROOT_DIR@/tmp
LogLevel debug
ErrorLog @MSC_REGRESSION_LOGS_DIR@/error.log

View File

@@ -909,7 +909,7 @@ SecAuditLogStorageDir logs/audit
more than N transformations to be cached. The cache will then be
disabled. A zero value is interpreted as "unlimited". This option
may be useful to limit caching for a form with a large number of
ARGS. (default: 1024)</para>
ARGS. (default: 512)</para>
</listitem>
<listitem>