File tree 1 file changed +18
-3
lines changed
1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -523,14 +523,29 @@ ngx_http_c_func_post_configuration(ngx_conf_t *cf) {
523
523
/***Enable pre content phase for apps concurrent processing request layer, NGX_DONE and wait for finalize request ***/
524
524
#if (nginx_version > 1013003 )
525
525
h = ngx_array_push (& cmcf -> phases [NGX_HTTP_PRECONTENT_PHASE ].handlers );
526
- #else /**Access Phase is the only last phase for multi thread**/
527
- h = ngx_array_push (& cmcf -> phases [NGX_HTTP_ACCESS_PHASE ].handlers );
528
- #endif
529
526
if (h == NULL ) {
530
527
return NGX_ERROR ;
531
528
}
532
529
533
530
* h = ngx_http_c_func_precontent_handler ;
531
+ #else
532
+ /**Access Phase is the only last phase for multi thread, we need to mimic to trick nginx c function access phase at first to register,
533
+ then it will be last to called as it is reverse order
534
+ **/
535
+ h = ngx_array_push (& cmcf -> phases [NGX_HTTP_ACCESS_PHASE ].handlers );
536
+ if (h == NULL ) {
537
+ return NGX_ERROR ;
538
+ }
539
+
540
+ h = cmcf -> phases [NGX_HTTP_ACCESS_PHASE ].handlers .elts ;
541
+ ngx_uint_t i ;
542
+ for (i = 0 ; i < cmcf -> phases [NGX_HTTP_ACCESS_PHASE ].handlers .nelts - 1 ; i ++ ) {
543
+ h [i + 1 ] = h [i ];
544
+ }
545
+
546
+ h [0 ] = ngx_http_c_func_precontent_handler ;
547
+ #endif
548
+
534
549
}
535
550
536
551
/*** Default Init for shm with 1M if pool is empty***/
You can’t perform that action at this time.
0 commit comments