summaryrefslogtreecommitdiffhomepage
path: root/src/http
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2012-01-30 07:39:47 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2012-01-30 07:39:47 +0000
commitb3e461e63c39875e63c40f9d620d1a4ece2a9134 (patch)
tree268e18dd02b9c7fb07fdc608222dad71e3deb62d /src/http
parent90a7a8f5d98b464b675c883383185a5048fc22db (diff)
downloadnginx-b3e461e63c39875e63c40f9d620d1a4ece2a9134.tar.gz
nginx-b3e461e63c39875e63c40f9d620d1a4ece2a9134.tar.bz2
Fixed AIO error handling on FreeBSD.
The aio_return() must be called regardless of the error returned by aio_error(). Not calling it resulted in various problems up to segmentation faults (as AIO events are level-triggered and were reported again and again). Additionally, in "aio sendfile" case r->blocked was incremented in case of error returned from ngx_file_aio_read(), thus causing request hangs.
Diffstat (limited to 'src/http')
-rw-r--r--src/http/ngx_http_copy_filter_module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http/ngx_http_copy_filter_module.c b/src/http/ngx_http_copy_filter_module.c
index 2d197c6e6..d52fbebe8 100644
--- a/src/http/ngx_http_copy_filter_module.c
+++ b/src/http/ngx_http_copy_filter_module.c
@@ -190,7 +190,7 @@ ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in)
rc = n;
- if (file->aio) {
+ if (rc == NGX_AGAIN) {
file->aio->data = r;
file->aio->handler = ngx_http_copy_aio_sendfile_event_handler;