Skip to content

Commit a5bbb83

Browse files
author
Felipe Zimmerle
committed
Fix compilation for 2.2.x and standalone after #1289
1 parent 4b5a635 commit a5bbb83

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

apache2/modsecurity.c

+4
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,11 @@ static void modsecurity_persist_data(modsec_rec *msr) {
237237
}
238238

239239
/* Remove stale collections. */
240+
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER > 3
240241
if (ap_random_pick(0, RAND_MAX) < RAND_MAX/100) {
242+
#else
243+
if (rand() < RAND_MAX/100) {
244+
#endif
241245
arr = apr_table_elts(msr->collections);
242246
te = (apr_table_entry_t *)arr->elts;
243247
for (i = 0; i < arr->nelts; i++) {

standalone/server.c

+5
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ static char *http2env(apr_pool_t *a, const char *w)
187187
return res;
188188
}
189189

190+
AP_DECLARE(apr_uint32_t) ap_random_pick(apr_uint32_t min, apr_uint32_t max)
191+
{
192+
return rand();
193+
}
194+
190195
AP_DECLARE(char *) ap_escape_html2(apr_pool_t *p, const char *s, int toasc)
191196
{
192197
int i, j;

0 commit comments

Comments
 (0)