comparison src/http/ngx_http_copy_filter_module.c @ 4415:30eff7580d0c

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 30 Jan 2012 07:39:47 +0000
parents d620f497c50f
children 586969d972b9
comparison
equal deleted inserted replaced
4414:e8c61e79364e 4415:30eff7580d0c
188 continue; 188 continue;
189 } 189 }
190 190
191 rc = n; 191 rc = n;
192 192
193 if (file->aio) { 193 if (rc == NGX_AGAIN) {
194 file->aio->data = r; 194 file->aio->data = r;
195 file->aio->handler = ngx_http_copy_aio_sendfile_event_handler; 195 file->aio->handler = ngx_http_copy_aio_sendfile_event_handler;
196 196
197 r->main->blocked++; 197 r->main->blocked++;
198 r->aio = 1; 198 r->aio = 1;