Skip to content

Commit 9b3c32b

Browse files
author
Felipe Zimmerle
committed
Makes #1308 compatible to older versions of Apache
1 parent 019edfa commit 9b3c32b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apache2/mod_security2.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ int perform_interception(modsec_rec *msr) {
267267
extern module core_module;
268268
apr_socket_t *csd;
269269

270+
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER > 2 && AP_SERVER_PATCHLEVEL_NUMBER > 17
270271
/* For mod_http2 used by HTTP/2 there is a virtual connection so must go through
271272
* master to get the main connection or the drop request doesn't seem to do anything.
272273
* For HTTP/1.1 master will not be defined so just go through normal connection.
@@ -277,7 +278,9 @@ int perform_interception(modsec_rec *msr) {
277278
} else {
278279
csd = ap_get_module_config(msr->r->connection->conn_config, &core_module);
279280
}
280-
281+
#else
282+
csd = ap_get_module_config(msr->r->connection->conn_config, &core_module);
283+
#endif
281284
if (csd) {
282285
if (apr_socket_close(csd) == APR_SUCCESS) {
283286
status = HTTP_FORBIDDEN;

0 commit comments

Comments
 (0)