@@ -96,11 +96,6 @@ int (*modsecDropAction)(request_rec *r) = NULL;
9696#endif
9797static int server_limit ,thread_limit ;
9898
99- typedef struct {
100- int child_num ;
101- int thread_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 */
14361431static int hook_connection_early (conn_rec * conn )
14371432{
1438- sb_handle * sb = conn -> sbh ;
1439- int i ,j ;
1440- unsigned longint ip_count_r = 0 ,ip_count_w = 0 ;
1441- char * error_msg ;
1442- worker_score * ws_record = NULL ;
14431433#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER > 2
1444- ap_sb_handle_t * sbh = NULL ;
1434+ ap_sb_handle_t * sbh = conn -> sbh ;
14451435char * client_ip = conn -> client_ip ;
14461436#else
1437+ sb_handle * sbh = conn -> sbh ;
14471438char * client_ip = conn -> remote_ip ;
14481439#endif
1440+ int i ,j ;
1441+ unsigned longint ip_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+ #if AP_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
14531452if (ws_record == NULL )
14541453return DECLINED ;
14551454
@@ -1462,11 +1461,6 @@ static int hook_connection_early(conn_rec *conn)
14621461for (j = 0 ;j < thread_limit ;++ j ) {
14631462
14641463#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER > 2
1465- sbh = conn -> sbh ;
1466- if (sbh == NULL ) {
1467- return DECLINED ;
1468- }
1469-
14701464ws_record = ap_get_scoreboard_worker (sbh );
14711465#else
14721466ws_record = ap_get_scoreboard_worker (i ,j );