changeset 3776:7450029ff51e

file AIO read may be posted inside loop
author Igor Sysoev <igor@sysoev.ru>
date Tue, 12 Oct 2010 12:06:52 +0000
parents 2902fc8487ae
children cd04f652478c
files src/core/ngx_output_chain.c src/http/ngx_http_copy_filter_module.c
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/ngx_output_chain.c	Mon Oct 11 18:48:18 2010 +0000
+++ b/src/core/ngx_output_chain.c	Tue Oct 12 12:06:52 2010 +0000
@@ -74,18 +74,18 @@
         }
     }
 
-#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) {
 
             /*
--- a/src/http/ngx_http_copy_filter_module.c	Mon Oct 11 18:48:18 2010 +0000
+++ b/src/http/ngx_http_copy_filter_module.c	Tue Oct 12 12:06:52 2010 +0000
@@ -211,6 +211,7 @@
 
     r->main->blocked++;
     r->aio = 1;
+    ctx->aio = 1;
 }