14 #define NGX_SENDFILE_LIMIT 4096
48 if (ctx->
in == NULL && ctx->
busy == NULL) {
64 && ngx_output_chain_as_is(ctx, in->
buf))
84 #if (NGX_HAVE_FILE_AIO)
102 "zero size buf in output "
103 "t:%d r:%d f:%d %p %p-%p %p %O-%O",
121 if (ngx_output_chain_as_is(ctx, ctx->
in->
buf)) {
129 last_out = &cl->
next;
135 if (ctx->
buf == NULL) {
137 rc = ngx_output_chain_align_file_buf(ctx, bsize);
159 }
else if (ngx_output_chain_get_buf(ctx, bsize) !=
NGX_OK) {
165 rc = ngx_output_chain_copy_buf(ctx);
193 last_out = &cl->
next;
197 if (out == NULL && last !=
NGX_NONE) {
234 #if (NGX_SENDFILE_LIMIT)
268 #if (NGX_SENDFILE_LIMIT)
274 for (cl = *chain; cl; cl = cl->
next) {
285 #if (NGX_SENDFILE_LIMIT)
350 if (bsize >= (off_t) ctx->
bufs.
size) {
354 size = (size_t) bsize;
359 if ((off_t) size > bsize) {
360 size = (size_t) bsize;
365 if (ctx->
buf == NULL) {
374 #if (NGX_HAVE_ALIGNED_DIRECTIO)
395 if (bsize < (off_t) size) {
402 size = (size_t) bsize;
407 && (bsize < (off_t) (size + size / 4)))
415 size = (size_t) bsize;
433 if (b->
start == NULL) {
439 if (b->
start == NULL) {
474 #if (NGX_SENDFILE_LIMIT)
484 src->
pos += (size_t) size;
485 dst->
last += (size_t) size;
513 #if (NGX_HAVE_ALIGNED_DIRECTIO)
515 if (ctx->unaligned) {
518 ngx_directio_off_n
" \"%s\" failed",
525 #if (NGX_HAVE_FILE_AIO)
527 if (ctx->aio_handler) {
531 ctx->aio_handler(ctx, src->
file);
545 #if (NGX_HAVE_ALIGNED_DIRECTIO)
547 if (ctx->unaligned) {
612 for (size = 0; in; in = in->
next) {
623 "chain writer buf fl:%d s:%uO",
638 "chain writer in: %p", ctx->
out);
640 for (cl = ctx->
out; cl; cl = cl->
next) {
659 "chain writer out: %p", ctx->
out);
665 if (ctx->
out == NULL) {