diff src/os/unix/ngx_file_aio_read.c @ 660:d0f7a625f27c NGINX_1_1_14

nginx 1.1.14 *) Feature: multiple "limit_req" limits may be used simultaneously. *) Bugfix: in error handling while connecting to a backend. Thanks to Piotr Sikora. *) Bugfix: in AIO error handling on FreeBSD. *) Bugfix: in the OpenSSL library initialization. *) Bugfix: the "proxy_redirect" directives might not be correctly inherited. *) Bugfix: memory leak during reconfiguration if the "pcre_jit" directive was used.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Jan 2012 00:00:00 +0400
parents eb208e0cf44d
children
line wrap: on
line diff
--- a/src/os/unix/ngx_file_aio_read.c
+++ b/src/os/unix/ngx_file_aio_read.c
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
@@ -156,24 +157,15 @@ ngx_file_aio_result(ngx_file_t *file, ng
         return NGX_ERROR;
     }
 
-    if (n != 0) {
-        if (n == NGX_EINPROGRESS) {
-            if (ev->ready) {
-                ev->ready = 0;
-                ngx_log_error(NGX_LOG_ALERT, file->log, n,
-                              "aio_read(\"%V\") still in progress",
-                              &file->name);
-            }
-
-            return NGX_AGAIN;
+    if (n == NGX_EINPROGRESS) {
+        if (ev->ready) {
+            ev->ready = 0;
+            ngx_log_error(NGX_LOG_ALERT, file->log, n,
+                          "aio_read(\"%V\") still in progress",
+                          &file->name);
         }
 
-        aio->err = n;
-        ev->ready = 0;
-
-        ngx_log_error(NGX_LOG_CRIT, file->log, n,
-                      "aio_read(\"%V\") failed", &file->name);
-        return NGX_ERROR;
+        return NGX_AGAIN;
     }
 
     n = aio_return(&aio->aiocb);
@@ -181,9 +173,9 @@ ngx_file_aio_result(ngx_file_t *file, ng
     if (n == -1) {
         err = ngx_errno;
         aio->err = err;
-        ev->ready = 0;
+        ev->ready = 1;
 
-        ngx_log_error(NGX_LOG_ALERT, file->log, err,
+        ngx_log_error(NGX_LOG_CRIT, file->log, err,
                       "aio_return(\"%V\") failed", &file->name);
         return NGX_ERROR;
     }