aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_socket.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2016-03-03 21:14:19 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2016-03-03 21:14:19 +0300
commit00fcc6a987f1d45a9eac91242de7e3527451242e (patch)
tree69a77bac2d1604f52cc22203d0d40656982b3150 /src/os/unix/ngx_socket.c
parenta6fe512df6111ad79cc04d315dc4bb5b6ef909cb (diff)
downloadnginx-00fcc6a987f1d45a9eac91242de7e3527451242e.tar.gz
nginx-00fcc6a987f1d45a9eac91242de7e3527451242e.zip
Copy filter: fixed sendfile aio handlers to set ctx->aio.
Sendfile handlers (aio preload and thread handler) are called within ctx->output_filter() in ngx_output_chain(), and hence ctx->aio cannot be set directly in ngx_output_chain(). Meanwhile, it must be set to make sure loop within ngx_output_chain() will be properly terminated. There are no known cases that trigger the problem, though in theory something like aio + sub filter (something that needs body in memory, and can also free some memory buffers) + sendfile can result in "task already active" and "second aio post" alerts. The fix is to set ctx->aio in ngx_http_copy_aio_sendfile_preload() and ngx_http_copy_thread_handler(). For consistency, ctx->aio is no longer set explicitly in ngx_output_chain_copy_buf(), as it's now done in ngx_http_copy_thread_handler().
Diffstat (limited to 'src/os/unix/ngx_socket.c')
0 files changed, 0 insertions, 0 deletions