@@ -109,7 +109,7 @@ ngx_http_modsecurity_store_ctx_header(ngx_http_request_t *r, ngx_str_t *name, ng
109109    ngx_http_modsecurity_conf_t     * mcf ;
110110    ngx_http_modsecurity_header_t   * hdr ;
111111
112-     ctx  =  ngx_http_get_module_ctx ( r ,  ngx_http_modsecurity_module );
112+     ctx  =  ngx_http_modsecurity_get_module_ctx ( r );
113113    if  (ctx  ==  NULL  ||  ctx -> sanity_headers_out  ==  NULL ) {
114114        return  NGX_ERROR ;
115115    }
@@ -152,7 +152,7 @@ ngx_http_modsecurity_resolv_header_server(ngx_http_request_t *r, ngx_str_t name,
152152    ngx_str_t  value ;
153153
154154    clcf  =  ngx_http_get_module_loc_conf (r , ngx_http_core_module );
155-     ctx  =  ngx_http_get_module_ctx ( r ,  ngx_http_modsecurity_module );
155+     ctx  =  ngx_http_modsecurity_get_module_ctx ( r );
156156
157157    if  (r -> headers_out .server  ==  NULL ) {
158158        if  (clcf -> server_tokens ) {
@@ -186,7 +186,7 @@ ngx_http_modsecurity_resolv_header_date(ngx_http_request_t *r, ngx_str_t name, o
186186    ngx_http_modsecurity_ctx_t  * ctx  =  NULL ;
187187    ngx_str_t  date ;
188188
189-     ctx  =  ngx_http_get_module_ctx ( r ,  ngx_http_modsecurity_module );
189+     ctx  =  ngx_http_modsecurity_get_module_ctx ( r );
190190
191191    if  (r -> headers_out .date  ==  NULL ) {
192192        date .data  =  ngx_cached_http_time .data ;
@@ -216,7 +216,7 @@ ngx_http_modsecurity_resolv_header_content_length(ngx_http_request_t *r, ngx_str
216216    ngx_str_t  value ;
217217    char  buf [NGX_INT64_LEN + 2 ];
218218
219-     ctx  =  ngx_http_get_module_ctx ( r ,  ngx_http_modsecurity_module );
219+     ctx  =  ngx_http_modsecurity_get_module_ctx ( r );
220220
221221    if  (r -> headers_out .content_length_n  >  0 )
222222    {
@@ -243,7 +243,7 @@ ngx_http_modsecurity_resolv_header_content_type(ngx_http_request_t *r, ngx_str_t
243243{
244244    ngx_http_modsecurity_ctx_t  * ctx  =  NULL ;
245245
246-     ctx  =  ngx_http_get_module_ctx ( r ,  ngx_http_modsecurity_module );
246+     ctx  =  ngx_http_modsecurity_get_module_ctx ( r );
247247
248248    if  (r -> headers_out .content_type .len  >  0 )
249249    {
@@ -270,7 +270,7 @@ ngx_http_modsecurity_resolv_header_last_modified(ngx_http_request_t *r, ngx_str_
270270    u_char  buf [1024 ], * p ;
271271    ngx_str_t  value ;
272272
273-     ctx  =  ngx_http_get_module_ctx ( r ,  ngx_http_modsecurity_module );
273+     ctx  =  ngx_http_modsecurity_get_module_ctx ( r );
274274
275275    if  (r -> headers_out .last_modified_time  ==  -1 ) {
276276        return  1 ;
@@ -302,7 +302,7 @@ ngx_http_modsecurity_resolv_header_connection(ngx_http_request_t *r, ngx_str_t n
302302    ngx_str_t  value ;
303303
304304    clcf  =  ngx_http_get_module_loc_conf (r , ngx_http_core_module );
305-     ctx  =  ngx_http_get_module_ctx ( r ,  ngx_http_modsecurity_module );
305+     ctx  =  ngx_http_modsecurity_get_module_ctx ( r );
306306
307307    if  (r -> headers_out .status  ==  NGX_HTTP_SWITCHING_PROTOCOLS ) {
308308        connection  =  "upgrade" ;
@@ -353,7 +353,7 @@ ngx_http_modsecurity_resolv_header_transfer_encoding(ngx_http_request_t *r, ngx_
353353    if  (r -> chunked ) {
354354        ngx_str_t  value  =  ngx_string ("chunked" );
355355
356-         ctx  =  ngx_http_get_module_ctx ( r ,  ngx_http_modsecurity_module );
356+         ctx  =  ngx_http_modsecurity_get_module_ctx ( r );
357357
358358#if  defined(MODSECURITY_SANITY_CHECKS ) &&  (MODSECURITY_SANITY_CHECKS )
359359        ngx_http_modsecurity_store_ctx_header (r , & name , & value );
@@ -380,7 +380,7 @@ ngx_http_modsecurity_resolv_header_vary(ngx_http_request_t *r, ngx_str_t name, o
380380    if  (r -> gzip_vary  &&  clcf -> gzip_vary ) {
381381        ngx_str_t  value  =  ngx_string ("Accept-Encoding" );
382382
383-         ctx  =  ngx_http_get_module_ctx ( r ,  ngx_http_modsecurity_module );
383+         ctx  =  ngx_http_modsecurity_get_module_ctx ( r );
384384
385385#if  defined(MODSECURITY_SANITY_CHECKS ) &&  (MODSECURITY_SANITY_CHECKS )
386386        ngx_http_modsecurity_store_ctx_header (r , & name , & value );
@@ -422,7 +422,7 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r)
422422
423423/* XXX: if NOT_MODIFIED, do we need to process it at all?  see xslt_header_filter() */ 
424424
425-     ctx  =  ngx_http_get_module_ctx ( r ,  ngx_http_modsecurity_module );
425+     ctx  =  ngx_http_modsecurity_get_module_ctx ( r );
426426
427427    dd ("header filter, recovering ctx: %p" , ctx );
428428
0 commit comments