comparison 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
comparison
equal deleted inserted replaced
659:d48f991d7bd0 660:d0f7a625f27c
1 1
2 /* 2 /*
3 * Copyright (C) Igor Sysoev 3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Nginx, Inc.
4 */ 5 */
5 6
6 7
7 #include <ngx_config.h> 8 #include <ngx_config.h>
8 #include <ngx_core.h> 9 #include <ngx_core.h>
154 ngx_log_error(NGX_LOG_ALERT, file->log, err, 155 ngx_log_error(NGX_LOG_ALERT, file->log, err,
155 "aio_error(\"%V\") failed", &file->name); 156 "aio_error(\"%V\") failed", &file->name);
156 return NGX_ERROR; 157 return NGX_ERROR;
157 } 158 }
158 159
159 if (n != 0) { 160 if (n == NGX_EINPROGRESS) {
160 if (n == NGX_EINPROGRESS) { 161 if (ev->ready) {
161 if (ev->ready) { 162 ev->ready = 0;
162 ev->ready = 0; 163 ngx_log_error(NGX_LOG_ALERT, file->log, n,
163 ngx_log_error(NGX_LOG_ALERT, file->log, n, 164 "aio_read(\"%V\") still in progress",
164 "aio_read(\"%V\") still in progress", 165 &file->name);
165 &file->name); 166 }
166 } 167
167 168 return NGX_AGAIN;
168 return NGX_AGAIN;
169 }
170
171 aio->err = n;
172 ev->ready = 0;
173
174 ngx_log_error(NGX_LOG_CRIT, file->log, n,
175 "aio_read(\"%V\") failed", &file->name);
176 return NGX_ERROR;
177 } 169 }
178 170
179 n = aio_return(&aio->aiocb); 171 n = aio_return(&aio->aiocb);
180 172
181 if (n == -1) { 173 if (n == -1) {
182 err = ngx_errno; 174 err = ngx_errno;
183 aio->err = err; 175 aio->err = err;
184 ev->ready = 0; 176 ev->ready = 1;
185 177
186 ngx_log_error(NGX_LOG_ALERT, file->log, err, 178 ngx_log_error(NGX_LOG_CRIT, file->log, err,
187 "aio_return(\"%V\") failed", &file->name); 179 "aio_return(\"%V\") failed", &file->name);
188 return NGX_ERROR; 180 return NGX_ERROR;
189 } 181 }
190 182
191 aio->err = 0; 183 aio->err = 0;