#endif
unsigned need_in_memory:1;
unsigned need_in_temp:1;
+#if (NGX_HAVE_FILE_AIO)
+ unsigned aio:1;
+
+ ngx_output_chain_aio_pt aio_handler;
+#endif
off_t alignment;
ngx_output_chain_filter_pt output_filter;
void *filter_ctx;
-
-#if (NGX_HAVE_FILE_AIO)
- ngx_output_chain_aio_pt aio;
-#endif
};
}
}
+#if (NGX_HAVE_FILE_AIO)
+ if (ctx->aio) {
+ return NGX_AGAIN;
+ }
+#endif
+
out = NULL;
last_out = &out;
last = NGX_NONE;
#if (NGX_HAVE_FILE_AIO)
- if (ctx->aio) {
+ if (ctx->aio_handler) {
n = ngx_file_aio_read(src->file, dst->pos, (size_t) size,
src->file_pos, ctx->pool);
if (n == NGX_AGAIN) {
- ctx->aio(ctx, src->file);
+ ctx->aio_handler(ctx, src->file);
return NGX_AGAIN;
}
c = r->connection;
- if (r->aio) {
- return NGX_AGAIN;
- }
-
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http copy filter: \"%V?%V\"", &r->uri, &r->args);
#if (NGX_HAVE_FILE_AIO)
if (clcf->aio) {
- ctx->aio = ngx_http_copy_aio_handler;
+ ctx->aio_handler = ngx_http_copy_aio_handler;
#if (NGX_HAVE_AIO_SENDFILE)
c->aio_sendfile = (clcf->aio == NGX_HTTP_AIO_SENDFILE);
#endif
r->request_output = 1;
}
+#if (NGX_HAVE_FILE_AIO)
+ ctx->aio = r->aio;
+#endif
+
for ( ;; ) {
rc = ngx_output_chain(ctx, in);