@@ -970,9 +970,14 @@ ngx_http_c_func_after_process(ngx_event_t *ev) {
970
970
static ngx_int_t
971
971
ngx_http_c_func_precontent_handler (ngx_http_request_t * r ) {
972
972
// ngx_str_t name;
973
- ngx_http_c_func_loc_conf_t * lcf = ngx_http_get_module_loc_conf (r , ngx_http_c_func_module );
974
- ngx_http_c_func_main_conf_t * mcf = ngx_http_get_module_main_conf (r , ngx_http_c_func_module );
975
- ngx_http_c_func_internal_ctx_t * internal_ctx ;
973
+ ngx_http_c_func_loc_conf_t * lcf = ngx_http_get_module_loc_conf (r , ngx_http_c_func_module );
974
+ ngx_http_c_func_main_conf_t * mcf = ngx_http_get_module_main_conf (r , ngx_http_c_func_module );
975
+ ngx_http_c_func_internal_ctx_t * internal_ctx ;
976
+ ngx_http_c_func_ctx_t * new_ctx ;
977
+
978
+ if (lcf -> _handler == NULL ) {
979
+ return NGX_DECLINED ;
980
+ }
976
981
977
982
internal_ctx = ngx_http_get_module_ctx (r , ngx_http_c_func_module );
978
983
@@ -998,12 +1003,7 @@ ngx_http_c_func_precontent_handler(ngx_http_request_t *r) {
998
1003
}
999
1004
1000
1005
new_task :
1001
- if (lcf -> _handler == NULL ) {
1002
- return NGX_DECLINED ;
1003
- }
1004
-
1005
-
1006
- ngx_http_c_func_ctx_t * new_ctx = ngx_pcalloc (r -> pool , sizeof (ngx_http_c_func_ctx_t ));
1006
+ new_ctx = ngx_pcalloc (r -> pool , sizeof (ngx_http_c_func_ctx_t ));
1007
1007
new_ctx -> __r__ = r ;
1008
1008
new_ctx -> __pl__ = r -> pool ;
1009
1009
new_ctx -> __log__ = r -> connection -> log ;
@@ -1157,10 +1157,14 @@ ngx_http_c_func_precontent_handler(ngx_http_request_t *r) {
1157
1157
*/
1158
1158
static ngx_int_t
1159
1159
ngx_http_c_func_rewrite_handler (ngx_http_request_t * r ) {
1160
- // ngx_http_c_func_loc_conf_t *lcf = ngx_http_get_module_loc_conf(r, ngx_http_c_func_module);
1160
+ ngx_http_c_func_loc_conf_t * lcf = ngx_http_get_module_loc_conf (r , ngx_http_c_func_module );
1161
1161
ngx_http_c_func_internal_ctx_t * ctx ;
1162
1162
ngx_int_t rc ;
1163
1163
1164
+ if (lcf -> _handler == NULL ) {
1165
+ return NGX_DECLINED ;
1166
+ }
1167
+
1164
1168
if (r -> method & (NGX_HTTP_POST | NGX_HTTP_PUT | NGX_HTTP_PATCH )) {
1165
1169
// r->request_body_in_single_buf = 1;
1166
1170
// r->request_body_in_clean_file = 1;
@@ -1220,8 +1224,7 @@ ngx_http_c_func_rewrite_handler(ngx_http_request_t *r) {
1220
1224
}
1221
1225
1222
1226
static void
1223
- ngx_http_c_func_client_body_handler (ngx_http_request_t * r )
1224
- {
1227
+ ngx_http_c_func_client_body_handler (ngx_http_request_t * r ) {
1225
1228
ngx_http_c_func_internal_ctx_t * ctx ;
1226
1229
ctx = ngx_http_get_module_ctx (r , ngx_http_c_func_module );
1227
1230
ctx -> done = 1 ;
0 commit comments