]> git.kaiwu.me - nginx.git/commitdiff
file AIO read may be posted inside loop
authorIgor Sysoev <igor@sysoev.ru>
Tue, 12 Oct 2010 12:06:52 +0000 (12:06 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 12 Oct 2010 12:06:52 +0000 (12:06 +0000)
src/core/ngx_output_chain.c
src/http/ngx_http_copy_filter_module.c

index f51d690004a731a08b809fd8a3d26c642256cb57..4f100a81837ec1370101de4748b2eb848f887ec4 100644 (file)
@@ -74,18 +74,18 @@ ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in)
         }
     }
 
-#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) {
 
             /*
index d492f321dedc0649a2cd69e6e805e59f3370231f..2dd4a627bf23c1e12de3b6590ba4d24623191a7a 100644 (file)
@@ -211,6 +211,7 @@ ngx_http_copy_aio_handler(ngx_output_chain_ctx_t *ctx, ngx_file_t *file)
 
     r->main->blocked++;
     r->aio = 1;
+    ctx->aio = 1;
 }