Skip to content

Commit c2fa67a

Browse files
committed
update PHASE version check
1 parent eb9e66a commit c2fa67a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ngx_http_c_func_module.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,11 @@ ngx_http_c_func_post_configuration(ngx_conf_t *cf) {
521521
*h = ngx_http_c_func_rewrite_handler;
522522

523523
/***Enable pre content phase for apps concurrent processing request layer, NGX_DONE and wait for finalize request ***/
524+
#if (nginx_version > 1013003)
524525
h = ngx_array_push(&cmcf->phases[NGX_HTTP_PRECONTENT_PHASE].handlers);
526+
#else
527+
h = ngx_array_push(&cmcf->phases[NGX_HTTP_TRY_FILES_PHASE].handlers);
528+
#endif
525529
if (h == NULL) {
526530
return NGX_ERROR;
527531
}
@@ -937,7 +941,6 @@ ngx_http_c_func_precontent_handler(ngx_http_request_t *r) {
937941
ngx_http_c_func_loc_conf_t *lcf = ngx_http_get_module_loc_conf(r, ngx_http_c_func_module);
938942
ngx_http_c_func_main_conf_t *mcf = ngx_http_get_module_main_conf(r, ngx_http_c_func_module);
939943
ngx_http_c_func_internal_ctx_t *internal_ctx;
940-
ngx_http_core_loc_conf_t *clcf;
941944

942945
internal_ctx = ngx_http_get_module_ctx(r, ngx_http_c_func_module);
943946

@@ -1071,6 +1074,7 @@ ngx_http_c_func_precontent_handler(ngx_http_request_t *r) {
10711074

10721075
#if (NGX_THREADS)
10731076
ngx_thread_pool_t *tp;
1077+
ngx_http_core_loc_conf_t *clcf;
10741078

10751079
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
10761080

0 commit comments

Comments
 (0)