@@ -134,7 +134,7 @@ static ngx_int_t ngx_http_c_func_get_resp_var(ngx_http_request_t *r, ngx_http_va
134134static void ngx_http_c_func_set_resp_var_with_r (ngx_http_request_t * r , ngx_http_c_func_ctx_t * ctx , const char * resp_content );
135135static void ngx_http_c_func_output_filter (ngx_http_request_t * r );
136136
137- #if (NGX_THREADS )
137+ #if (NGX_THREADS ) && ( nginx_version > 1013003 )
138138static void ngx_http_c_func_after_process (ngx_event_t * ev );
139139static void ngx_http_c_func_process_t_handler (void * data , ngx_log_t * log );
140140#endif
@@ -523,8 +523,8 @@ ngx_http_c_func_post_configuration(ngx_conf_t *cf) {
523523 /***Enable pre content phase for apps concurrent processing request layer, NGX_DONE and wait for finalize request ***/
524524#if (nginx_version > 1013003 )
525525 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 );
526+ #else /**Access Phase is the only last phase for multi thread**/
527+ h = ngx_array_push (& cmcf -> phases [NGX_HTTP_CONTENT_PHASE ].handlers );
528528#endif
529529 if (h == NULL ) {
530530 return NGX_ERROR ;
@@ -887,7 +887,7 @@ ngx_http_c_func_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) {
887887 return NGX_CONF_OK ;
888888}
889889
890- #if (NGX_THREADS )
890+ #if (NGX_THREADS ) && ( nginx_version > 1013003 )
891891static void
892892ngx_http_c_func_process_t_handler (void * data , ngx_log_t * log )
893893{
@@ -1072,7 +1072,7 @@ ngx_http_c_func_precontent_handler(ngx_http_request_t *r) {
10721072 new_ctx -> req_body = NULL ;
10731073 }
10741074
1075- #if (NGX_THREADS )
1075+ #if (NGX_THREADS ) && ( nginx_version > 1013003 )
10761076 ngx_thread_pool_t * tp ;
10771077 ngx_http_core_loc_conf_t * clcf ;
10781078
@@ -1097,14 +1097,18 @@ ngx_http_c_func_precontent_handler(ngx_http_request_t *r) {
10971097 r -> main -> blocked ++ ;
10981098 r -> aio = 1 ;
10991099 return NGX_DONE ;
1100- #endif
11011100single_thread :
1101+ #endif
11021102 lcf -> _handler (new_ctx );
11031103 if (lcf -> _is_call_to_var ) {
11041104 return NGX_DECLINED ;
11051105 }
11061106 ngx_http_c_func_output_filter (r );
1107+ #if (nginx_version > 1013003 )
11071108 return NGX_DONE ;
1109+ #else
1110+ return NGX_OK ;
1111+ #endif
11081112} /* ngx_http_c_func_precontent_handler */
11091113
11101114
0 commit comments