Mercurial > hg > nginx
diff src/os/unix/ngx_freebsd_sendfile_chain.c @ 7987:b002ad258f1d
Support for sendfile(SF_NOCACHE).
The SF_NOCACHE flag, introduced in FreeBSD 11 along with the new non-blocking
sendfile() implementation by glebius@, makes it possible to use sendfile()
along with the "directio" directive.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 27 Dec 2021 19:49:26 +0300 |
parents | ec2e6893caaa |
children |
line wrap: on
line diff
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c Mon Dec 27 19:48:42 2021 +0300 +++ b/src/os/unix/ngx_freebsd_sendfile_chain.c Mon Dec 27 19:49:26 2021 +0300 @@ -174,7 +174,13 @@ sent = 0; #if (NGX_HAVE_SENDFILE_NODISKIO) + flags = (c->busy_count <= 2) ? SF_NODISKIO : 0; + + if (file->file->directio) { + flags |= SF_NOCACHE; + } + #endif rc = sendfile(file->file->fd, c->fd, file->file_pos,