comparison src/http/modules/ngx_http_image_filter_module.c @ 490:e66f886a8305 NGINX_0_7_57

nginx 0.7.57 *) Bugfix: a segmentation fault occurred in worker process, if the ngx_http_image_filter_module errors were redirected to named location; the bug had appeared in 0.7.56.
author Igor Sysoev <http://sysoev.ru>
date Tue, 12 May 2009 00:00:00 +0400
parents 829f9a66a659
children 98143f74eb3d
comparison
equal deleted inserted replaced
489:c91fb8e75a55 490:e66f886a8305
160 160
161 if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED) { 161 if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED) {
162 return ngx_http_next_header_filter(r); 162 return ngx_http_next_header_filter(r);
163 } 163 }
164 164
165 ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module);
166
167 if (ctx) {
168 ngx_http_set_ctx(r, NULL, ngx_http_image_filter_module);
169 return ngx_http_next_header_filter(r);
170 }
171
165 conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module); 172 conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module);
166 173
167 if (conf->filter == NGX_HTTP_IMAGE_OFF) { 174 if (conf->filter == NGX_HTTP_IMAGE_OFF) {
168 return ngx_http_next_header_filter(r); 175 return ngx_http_next_header_filter(r);
169 } 176 }
179 "image filter: multipart/x-mixed-replace response"); 186 "image filter: multipart/x-mixed-replace response");
180 187
181 return NGX_ERROR; 188 return NGX_ERROR;
182 } 189 }
183 190
184 ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module);
185
186 if (ctx) {
187 ngx_http_set_ctx(r, NULL, ngx_http_image_filter_module);
188 return ngx_http_next_header_filter(r);
189 }
190
191 ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_image_filter_ctx_t)); 191 ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_image_filter_ctx_t));
192 if (ctx == NULL) { 192 if (ctx == NULL) {
193 return NGX_ERROR; 193 return NGX_ERROR;
194 } 194 }
195 195