mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Fix compilation for 2.2.x and standalone after #1289
This commit is contained in:
parent
4b5a6350af
commit
a5bbb8345f
@ -237,7 +237,11 @@ static void modsecurity_persist_data(modsec_rec *msr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Remove stale collections. */
|
/* Remove stale collections. */
|
||||||
|
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER > 3
|
||||||
if (ap_random_pick(0, RAND_MAX) < RAND_MAX/100) {
|
if (ap_random_pick(0, RAND_MAX) < RAND_MAX/100) {
|
||||||
|
#else
|
||||||
|
if (rand() < RAND_MAX/100) {
|
||||||
|
#endif
|
||||||
arr = apr_table_elts(msr->collections);
|
arr = apr_table_elts(msr->collections);
|
||||||
te = (apr_table_entry_t *)arr->elts;
|
te = (apr_table_entry_t *)arr->elts;
|
||||||
for (i = 0; i < arr->nelts; i++) {
|
for (i = 0; i < arr->nelts; i++) {
|
||||||
|
@ -187,6 +187,11 @@ static char *http2env(apr_pool_t *a, const char *w)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AP_DECLARE(apr_uint32_t) ap_random_pick(apr_uint32_t min, apr_uint32_t max)
|
||||||
|
{
|
||||||
|
return rand();
|
||||||
|
}
|
||||||
|
|
||||||
AP_DECLARE(char *) ap_escape_html2(apr_pool_t *p, const char *s, int toasc)
|
AP_DECLARE(char *) ap_escape_html2(apr_pool_t *p, const char *s, int toasc)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user