# HG changeset patch # User Igor Sysoev # Date 1286885212 0 # Node ID 7450029ff51e3bb5c73838d915027f64d9958b30 # Parent 2902fc8487aebd2f1615042a78bd3f86f868417b file AIO read may be posted inside loop diff --git a/src/core/ngx_output_chain.c b/src/core/ngx_output_chain.c --- a/src/core/ngx_output_chain.c +++ b/src/core/ngx_output_chain.c @@ -74,18 +74,18 @@ ngx_output_chain(ngx_output_chain_ctx_t } } -#if (NGX_HAVE_FILE_AIO) - if (ctx->aio) { - return NGX_AGAIN; - } -#endif - out = NULL; last_out = &out; last = NGX_NONE; for ( ;; ) { +#if (NGX_HAVE_FILE_AIO) + if (ctx->aio) { + return NGX_AGAIN; + } +#endif + while (ctx->in) { /* diff --git a/src/http/ngx_http_copy_filter_module.c b/src/http/ngx_http_copy_filter_module.c --- a/src/http/ngx_http_copy_filter_module.c +++ b/src/http/ngx_http_copy_filter_module.c @@ -211,6 +211,7 @@ ngx_http_copy_aio_handler(ngx_output_cha r->main->blocked++; r->aio = 1; + ctx->aio = 1; }