Skip to content

Commit 42af67d

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

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apache2/modsecurity.c

Lines changed: 4 additions & 0 deletions
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++) {

0 commit comments

Comments
 (0)