comparison src/http/modules/ngx_http_xslt_filter_module.c @ 5039:b5601d23b61e stable-1.2

Merge of r4947: xslt: prevented infinite loop. If XSLT transformation failed and error 500 was handled in the same location, an infinite loop occured that exhausted the stack.
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 10 Feb 2013 03:00:55 +0000
parents bd45a98ff226
children
comparison
equal deleted inserted replaced
5038:1559423ec28b 5039:b5601d23b61e
305 ngx_pool_cleanup_t *cln; 305 ngx_pool_cleanup_t *cln;
306 306
307 ctx->done = 1; 307 ctx->done = 1;
308 308
309 if (b == NULL) { 309 if (b == NULL) {
310 return ngx_http_filter_finalize_request(r, NULL, 310 return ngx_http_filter_finalize_request(r, &ngx_http_xslt_filter_module,
311 NGX_HTTP_INTERNAL_SERVER_ERROR); 311 NGX_HTTP_INTERNAL_SERVER_ERROR);
312 } 312 }
313 313
314 cln = ngx_pool_cleanup_add(r->pool, 0); 314 cln = ngx_pool_cleanup_add(r->pool, 0);
315 315
316 if (cln == NULL) { 316 if (cln == NULL) {
317 ngx_free(b->pos); 317 ngx_free(b->pos);
318 return ngx_http_filter_finalize_request(r, NULL, 318 return ngx_http_filter_finalize_request(r, &ngx_http_xslt_filter_module,
319 NGX_HTTP_INTERNAL_SERVER_ERROR); 319 NGX_HTTP_INTERNAL_SERVER_ERROR);
320 } 320 }
321 321
322 if (r == r->main) { 322 if (r == r->main) {
323 r->headers_out.content_length_n = b->last - b->pos; 323 r->headers_out.content_length_n = b->last - b->pos;