18 #if (NGX_HAVE_FILE_AIO)
21 static void ngx_http_copy_aio_event_handler(
ngx_event_t *ev);
22 #if (NGX_HAVE_AIO_SENDFILE)
23 static void ngx_http_copy_aio_sendfile_event_handler(
ngx_event_t *ev);
27 static void *ngx_http_copy_filter_create_conf(
ngx_conf_t *cf);
28 static char *ngx_http_copy_filter_merge_conf(
ngx_conf_t *cf,
29 void *parent,
void *child);
48 ngx_http_copy_filter_init,
56 ngx_http_copy_filter_create_conf,
57 ngx_http_copy_filter_merge_conf
63 &ngx_http_copy_filter_module_ctx,
64 ngx_http_copy_filter_commands,
92 "http copy filter: \"%V?%V\"", &r->
uri, &r->
args);
119 ngx_http_next_body_filter;
122 #if (NGX_HAVE_FILE_AIO)
125 ctx->aio_handler = ngx_http_copy_aio_handler;
127 #if (NGX_HAVE_AIO_SENDFILE)
138 #if (NGX_HAVE_FILE_AIO)
145 if (ctx->
in == NULL) {
153 "http copy filter: %i \"%V?%V\"", rc, &r->
uri, &r->
args);
155 #if (NGX_HAVE_FILE_AIO && NGX_HAVE_AIO_SENDFILE)
157 if (c->busy_sendfile) {
164 c->busy_sendfile = NULL;
168 file = c->busy_sendfile->file;
169 offset = c->busy_sendfile->file_pos;
172 c->aio_sendfile = (offset != file->aio->last_offset);
173 file->aio->last_offset = offset;
175 if (c->aio_sendfile == 0) {
177 "sendfile(%V) returned busy again",
182 c->busy_sendfile = NULL;
196 file->aio->handler = ngx_http_copy_aio_sendfile_event_handler;
209 #if (NGX_HAVE_FILE_AIO)
219 file->aio->handler = ngx_http_copy_aio_event_handler;
243 #if (NGX_HAVE_AIO_SENDFILE)
246 ngx_http_copy_aio_sendfile_event_handler(
ngx_event_t *ev)
266 ngx_http_copy_filter_create_conf(
ngx_conf_t *cf)
282 ngx_http_copy_filter_merge_conf(
ngx_conf_t *cf,
void *parent,
void *child)