summaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_buf.h9
-rw-r--r--src/core/ngx_output_chain.c10
2 files changed, 13 insertions, 6 deletions
diff --git a/src/core/ngx_buf.h b/src/core/ngx_buf.h
index ba4854489..847eaad05 100644
--- a/src/core/ngx_buf.h
+++ b/src/core/ngx_buf.h
@@ -89,6 +89,11 @@ struct ngx_output_chain_ctx_s {
#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;
@@ -99,10 +104,6 @@ struct ngx_output_chain_ctx_s {
ngx_output_chain_filter_pt output_filter;
void *filter_ctx;
-
-#if (NGX_HAVE_FILE_AIO)
- ngx_output_chain_aio_pt aio;
-#endif
};
diff --git a/src/core/ngx_output_chain.c b/src/core/ngx_output_chain.c
index 0e3925812..01f42a191 100644
--- a/src/core/ngx_output_chain.c
+++ b/src/core/ngx_output_chain.c
@@ -74,6 +74,12 @@ ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in)
}
}
+#if (NGX_HAVE_FILE_AIO)
+ if (ctx->aio) {
+ return NGX_AGAIN;
+ }
+#endif
+
out = NULL;
last_out = &out;
last = NGX_NONE;
@@ -519,11 +525,11 @@ ngx_output_chain_copy_buf(ngx_output_chain_ctx_t *ctx)
#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;
}