Mercurial > hg > nginx-quic
comparison src/http/modules/ngx_http_image_filter_module.c @ 2834:0449d289256c
test finalized image filter context before testing image_filter off
this fixes SIGFPE if image filter errors are passed to named location
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 12 May 2009 12:05:29 +0000 |
parents | 26e06e009ced |
children | 0d8941f2b0ee |
comparison
equal
deleted
inserted
replaced
2833:cc5d214387f4 | 2834:0449d289256c |
---|---|
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 |