From f4d00a96acd56fb0d41233f5f1346f051528129a Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Sun, 5 Feb 2012 20:05:11 +0000 Subject: Merge of r4416: 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. --- src/http/ngx_http_copy_filter_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/http') 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; -- cgit