comparison src/http/ngx_http_copy_filter_module.c @ 526:0161f3197817 NGINX_0_8_15

nginx 0.8.15 *) Security: a segmentation fault might occur in worker process while specially crafted request handling. Thanks to Chris Ries. *) Bugfix: if names .domain.tld, .sub.domain.tld, and .domain-some.tld were defined, then the name .sub.domain.tld was matched by .domain.tld. *) Bugfix: in transparency support in the ngx_http_image_filter_module. *) Bugfix: in file AIO. *) Bugfix: in X-Accel-Redirect usage; the bug had appeared in 0.8.11. *) Bugfix: in embedded perl module; the bug had appeared in 0.8.11.
author Igor Sysoev <http://sysoev.ru>
date Mon, 14 Sep 2009 00:00:00 +0400
parents 80f7156c2965
children 2b9e388c61f1
comparison
equal deleted inserted replaced
525:1b64f9884263 526:0161f3197817
85 ngx_http_core_loc_conf_t *clcf; 85 ngx_http_core_loc_conf_t *clcf;
86 ngx_http_copy_filter_conf_t *conf; 86 ngx_http_copy_filter_conf_t *conf;
87 87
88 c = r->connection; 88 c = r->connection;
89 89
90 if (r->aio) {
91 return NGX_AGAIN;
92 }
93
94 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, 90 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
95 "http copy filter: \"%V?%V\"", &r->uri, &r->args); 91 "http copy filter: \"%V?%V\"", &r->uri, &r->args);
96 92
97 ctx = ngx_http_get_module_ctx(r, ngx_http_copy_filter_module); 93 ctx = ngx_http_get_module_ctx(r, ngx_http_copy_filter_module);
98 94
121 ctx->output_filter = (ngx_output_chain_filter_pt) ngx_http_next_filter; 117 ctx->output_filter = (ngx_output_chain_filter_pt) ngx_http_next_filter;
122 ctx->filter_ctx = r; 118 ctx->filter_ctx = r;
123 119
124 #if (NGX_HAVE_FILE_AIO) 120 #if (NGX_HAVE_FILE_AIO)
125 if (clcf->aio) { 121 if (clcf->aio) {
126 ctx->aio = ngx_http_copy_aio_handler; 122 ctx->aio_handler = ngx_http_copy_aio_handler;
127 #if (NGX_HAVE_AIO_SENDFILE) 123 #if (NGX_HAVE_AIO_SENDFILE)
128 c->aio_sendfile = (clcf->aio == NGX_HTTP_AIO_SENDFILE); 124 c->aio_sendfile = (clcf->aio == NGX_HTTP_AIO_SENDFILE);
129 #endif 125 #endif
130 } 126 }
131 #endif 127 #endif
132 128
133 r->request_output = 1; 129 r->request_output = 1;
134 } 130 }
131
132 #if (NGX_HAVE_FILE_AIO)
133 ctx->aio = r->aio;
134 #endif
135 135
136 for ( ;; ) { 136 for ( ;; ) {
137 rc = ngx_output_chain(ctx, in); 137 rc = ngx_output_chain(ctx, in);
138 138
139 if (ctx->in == NULL) { 139 if (ctx->in == NULL) {
172 e = (ngx_http_ephemeral_t *) &r->uri_start; 172 e = (ngx_http_ephemeral_t *) &r->uri_start;
173 173
174 n = ngx_file_aio_read(file, &e->aio_preload, 1, offset, r->pool); 174 n = ngx_file_aio_read(file, &e->aio_preload, 1, offset, r->pool);
175 175
176 if (n > 0) { 176 if (n > 0) {
177 in = NULL;
177 continue; 178 continue;
178 } 179 }
179 180
180 rc = n; 181 rc = n;
181 182