Skip to content

Commit a2eb4c8

Browse files
tjikkunFelipe Zimmerle
authored and
Felipe Zimmerle
committed
Don't update the scoreboard ourself (fixes #1337)
This is unsafe, and messes up the scoreboard on Apache >= 2.4.25 with Event MPM
1 parent 53edb25 commit a2eb4c8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

apache2/mod_security2.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,19 @@ static int hook_connection_early(conn_rec *conn)
14521452
if (ws_record == NULL)
14531453
return DECLINED;
14541454

1455-
apr_cpystrn(ws_record->client, client_ip, sizeof(ws_record->client));
1455+
/* If ws_record does not have correct ip yet, we count it already */
1456+
if (strcmp(client_ip, ws_record->client) != 0) {
1457+
switch (ws_record->status) {
1458+
case SERVER_BUSY_READ:
1459+
ip_count_r++;
1460+
break;
1461+
case SERVER_BUSY_WRITE:
1462+
ip_count_w++;
1463+
break;
1464+
default:
1465+
break;
1466+
}
1467+
}
14561468

14571469
ap_log_cerror(APLOG_MARK, APLOG_TRACE3, 0, conn,
14581470
"ModSecurity: going to loop through %d servers with %d threads",

0 commit comments

Comments
 (0)