Mercurial > hg > nginx-mail
comparison src/core/ngx_output_chain.c @ 665:0b460e61bdcd default tip
Merge with nginx 1.0.0.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 25 Apr 2011 04:22:17 +0400 |
parents | c5122335e41d |
children |
comparison
equal
deleted
inserted
replaced
572:06419a2298a9 | 665:0b460e61bdcd |
---|---|
72 if (ngx_output_chain_add_copy(ctx->pool, &ctx->in, in) == NGX_ERROR) { | 72 if (ngx_output_chain_add_copy(ctx->pool, &ctx->in, in) == NGX_ERROR) { |
73 return NGX_ERROR; | 73 return NGX_ERROR; |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 #if (NGX_HAVE_FILE_AIO) | |
78 if (ctx->aio) { | |
79 return NGX_AGAIN; | |
80 } | |
81 #endif | |
82 | |
83 out = NULL; | 77 out = NULL; |
84 last_out = &out; | 78 last_out = &out; |
85 last = NGX_NONE; | 79 last = NGX_NONE; |
86 | 80 |
87 for ( ;; ) { | 81 for ( ;; ) { |
82 | |
83 #if (NGX_HAVE_FILE_AIO) | |
84 if (ctx->aio) { | |
85 return NGX_AGAIN; | |
86 } | |
87 #endif | |
88 | 88 |
89 while (ctx->in) { | 89 while (ctx->in) { |
90 | 90 |
91 /* | 91 /* |
92 * cycle while there are the ctx->in bufs | 92 * cycle while there are the ctx->in bufs |
463 | 463 |
464 src = ctx->in->buf; | 464 src = ctx->in->buf; |
465 dst = ctx->buf; | 465 dst = ctx->buf; |
466 | 466 |
467 size = ngx_buf_size(src); | 467 size = ngx_buf_size(src); |
468 | 468 size = ngx_min(size, dst->end - dst->pos); |
469 if (size > dst->end - dst->pos) { | |
470 size = dst->end - dst->pos; | |
471 } | |
472 | 469 |
473 sendfile = ctx->sendfile & !ctx->directio; | 470 sendfile = ctx->sendfile & !ctx->directio; |
474 | 471 |
475 #if (NGX_SENDFILE_LIMIT) | 472 #if (NGX_SENDFILE_LIMIT) |
476 | 473 |
512 } else { | 509 } else { |
513 | 510 |
514 #if (NGX_HAVE_ALIGNED_DIRECTIO) | 511 #if (NGX_HAVE_ALIGNED_DIRECTIO) |
515 | 512 |
516 if (ctx->unaligned) { | 513 if (ctx->unaligned) { |
517 if (ngx_directio_off(src->file->fd) == -1) { | 514 if (ngx_directio_off(src->file->fd) == NGX_FILE_ERROR) { |
518 ngx_log_error(NGX_LOG_ALERT, ctx->pool->log, ngx_errno, | 515 ngx_log_error(NGX_LOG_ALERT, ctx->pool->log, ngx_errno, |
519 ngx_directio_off_n " \"%s\" failed", | 516 ngx_directio_off_n " \"%s\" failed", |
520 src->file->name.data); | 517 src->file->name.data); |
521 } | 518 } |
522 } | 519 } |
548 if (ctx->unaligned) { | 545 if (ctx->unaligned) { |
549 ngx_err_t err; | 546 ngx_err_t err; |
550 | 547 |
551 err = ngx_errno; | 548 err = ngx_errno; |
552 | 549 |
553 if (ngx_directio_on(src->file->fd) == -1) { | 550 if (ngx_directio_on(src->file->fd) == NGX_FILE_ERROR) { |
554 ngx_log_error(NGX_LOG_ALERT, ctx->pool->log, ngx_errno, | 551 ngx_log_error(NGX_LOG_ALERT, ctx->pool->log, ngx_errno, |
555 ngx_directio_on_n " \"%s\" failed", | 552 ngx_directio_on_n " \"%s\" failed", |
556 src->file->name.data); | 553 src->file->name.data); |
557 } | 554 } |
558 | 555 |