comparison src/event/ngx_event_openssl.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 f1fcb0fe6975
children aeab41dfd260 eaf356a35f5d
comparison
equal deleted inserted replaced
7986:f1fcb0fe6975 7987:b002ad258f1d
2953 file->file_pos, size); 2953 file->file_pos, size);
2954 2954
2955 ngx_set_errno(0); 2955 ngx_set_errno(0);
2956 2956
2957 #if (NGX_HAVE_SENDFILE_NODISKIO) 2957 #if (NGX_HAVE_SENDFILE_NODISKIO)
2958
2958 flags = (c->busy_count <= 2) ? SF_NODISKIO : 0; 2959 flags = (c->busy_count <= 2) ? SF_NODISKIO : 0;
2960
2961 if (file->file->directio) {
2962 flags |= SF_NOCACHE;
2963 }
2964
2959 #else 2965 #else
2960 flags = 0; 2966 flags = 0;
2961 #endif 2967 #endif
2962 2968
2963 n = SSL_sendfile(c->ssl->connection, file->file->fd, file->file_pos, 2969 n = SSL_sendfile(c->ssl->connection, file->file->fd, file->file_pos,