Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8efece9

Browse files
tjikkunFelipe Zimmerle
authored and
Felipe Zimmerle
committed
don't use sb_handle on apache 2.4
1 parentf813365 commit8efece9

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

‎apache2/mod_security2.c‎

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ int (*modsecDropAction)(request_rec *r) = NULL;
9696
#endif
9797
staticintserver_limit,thread_limit;
9898

99-
typedefstruct {
100-
intchild_num;
101-
intthread_num;
102-
}sb_handle;
103-
10499
/* -- Miscellaneous functions -- */
105100

106101
/**
@@ -1435,21 +1430,25 @@ static void modsec_register_operator(const char *name, void *fn_init, void *fn_e
14351430
*/
14361431
staticinthook_connection_early(conn_rec*conn)
14371432
{
1438-
sb_handle*sb=conn->sbh;
1439-
inti,j;
1440-
unsigned longintip_count_r=0,ip_count_w=0;
1441-
char*error_msg;
1442-
worker_score*ws_record=NULL;
14431433
#ifAP_SERVER_MAJORVERSION_NUMBER>1&&AP_SERVER_MINORVERSION_NUMBER>2
1444-
ap_sb_handle_t*sbh=NULL;
1434+
ap_sb_handle_t*sbh=conn->sbh;
14451435
char*client_ip=conn->client_ip;
14461436
#else
1437+
sb_handle*sbh=conn->sbh;
14471438
char*client_ip=conn->remote_ip;
14481439
#endif
1440+
inti,j;
1441+
unsigned longintip_count_r=0,ip_count_w=0;
1442+
char*error_msg;
1443+
worker_score*ws_record=NULL;
14491444

1450-
if (sb!=NULL&& (conn_read_state_limit>0||conn_write_state_limit>0)) {
1445+
if (sbh!=NULL&& (conn_read_state_limit>0||conn_write_state_limit>0)) {
14511446

1452-
ws_record=&ap_scoreboard_image->servers[sb->child_num][sb->thread_num];
1447+
#ifAP_SERVER_MAJORVERSION_NUMBER>1&&AP_SERVER_MINORVERSION_NUMBER>2
1448+
ws_record=ap_get_scoreboard_worker(sbh);
1449+
#else
1450+
ws_record=ap_get_scoreboard_worker(sbh->child_num,sbh->thread_num);
1451+
#endif
14531452
if (ws_record==NULL)
14541453
returnDECLINED;
14551454

@@ -1462,11 +1461,6 @@ static int hook_connection_early(conn_rec *conn)
14621461
for (j=0;j<thread_limit;++j) {
14631462

14641463
#ifAP_SERVER_MAJORVERSION_NUMBER>1&&AP_SERVER_MINORVERSION_NUMBER>2
1465-
sbh=conn->sbh;
1466-
if (sbh==NULL) {
1467-
returnDECLINED;
1468-
}
1469-
14701464
ws_record=ap_get_scoreboard_worker(sbh);
14711465
#else
14721466
ws_record=ap_get_scoreboard_worker(i,j);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp