static ngx_inline ngx_int_t⏎ ngx_output_chain_as_is(ngx_output_chain_ctx_t *ctx, ngx_buf_t *buf);⏎ #if (NGX_HAVE_AIO_SENDFILE)⏎ static ngx_int_t ngx_output_chain_aio_setup(ngx_output_chain_ctx_t *ctx,⏎ ngx_file_t *file);⏎ #endif⏎ static ngx_int_t ngx_output_chain_add_copy(ngx_pool_t *pool,⏎ ngx_chain_t **chain, ngx_chain_t *in);⏎ static ngx_int_t ngx_output_chain_align_file_buf(ngx_output_chain_ctx_t *ctx,⏎ off_t bsize);⏎ static ngx_int_t ngx_output_chain_get_buf(ngx_output_chain_ctx_t *ctx,⏎ off_t bsize);⏎ static ngx_int_t ngx_output_chain_copy_buf(ngx_output_chain_ctx_t *ctx);⏎ ⏎ ⏎ ngx_int_t⏎ ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in)⏎ {⏎ off_t bsize;⏎ ngx_int_t rc, last;⏎ ngx_chain_t *cl, *out, **last_out;⏎ ⏎ if (ctx->in == NULL && ctx->busy == NULL⏎ #if (NGX_HAVE_FILE_AIO || NGX_THREADS)⏎ && !ctx->aio⏎ #endif⏎ )⏎ {⏎ /*⏎ * the short path for the case when the ctx->in and ctx->busy chains⏎ * are empty, the incoming chain is empty too or has the single buf⏎ * that does not require the copy⏎ */⏎ ⏎ if (in == NULL) {⏎ return ctx->output_filter(ctx->filter_ctx, in);⏎ }⏎ ⏎ if (in->next == NULL⏎ #if (NGX_SENDFILE_LIMIT)⏎ && !(in->buf->in_file && in->buf->file_last > NGX_SENDFILE_LIMIT)⏎ #endif⏎ && ngx_output_chain_as_is(ctx, in->buf))⏎ {⏎ return ctx->output_filter(ctx->filter_ctx, in);⏎ }⏎ }⏎ ⏎ /* add the incoming buf to the chain ctx->in */⏎ ⏎ if (in) {⏎ if (ngx_output_chain_add_copy(ctx->pool, &ctx->in, in) == NGX_ERROR) {⏎ return NGX_ERROR;⏎ }⏎ }⏎