diff options
Diffstat (limited to 'src/core/ngx_output_chain.c')
-rw-r--r-- | src/core/ngx_output_chain.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/core/ngx_output_chain.c b/src/core/ngx_output_chain.c index 41267eeff..857074253 100644 --- a/src/core/ngx_output_chain.c +++ b/src/core/ngx_output_chain.c @@ -256,10 +256,6 @@ ngx_output_chain_as_is(ngx_output_chain_ctx_t *ctx, ngx_buf_t *buf) } #endif - if (buf->in_file && buf->file->directio) { - return 0; - } - sendfile = ctx->sendfile; #if (NGX_SENDFILE_LIMIT) @@ -270,6 +266,19 @@ ngx_output_chain_as_is(ngx_output_chain_ctx_t *ctx, ngx_buf_t *buf) #endif +#if !(NGX_HAVE_SENDFILE_NODISKIO) + + /* + * With DIRECTIO, disable sendfile() unless sendfile(SF_NOCACHE) + * is available. + */ + + if (buf->in_file && buf->file->directio) { + sendfile = 0; + } + +#endif + if (!sendfile) { if (!ngx_buf_in_memory(buf)) { |