Mercurial > hg > nginx
comparison src/http/modules/ngx_http_xslt_filter_module.c @ 2899:61d5b945730a
fix XSLT filter in SSI subrequests
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 28 May 2009 15:42:27 +0000 |
parents | 896db5a09bd2 |
children | c7d57b539248 8ba95d7cab37 |
comparison
equal
deleted
inserted
replaced
2898:a3501111378c | 2899:61d5b945730a |
---|---|
278 xmlFreeParserCtxt(ctx->ctxt); | 278 xmlFreeParserCtxt(ctx->ctxt); |
279 | 279 |
280 return ngx_http_xslt_send(r, ctx, NULL); | 280 return ngx_http_xslt_send(r, ctx, NULL); |
281 } | 281 } |
282 | 282 |
283 if (cl->buf->last_buf) { | 283 if (cl->buf->last_buf || cl->buf->last_in_chain) { |
284 | 284 |
285 ctx->doc = ctx->ctxt->myDoc; | 285 ctx->doc = ctx->ctxt->myDoc; |
286 | 286 |
287 #if (NGX_HTTP_XSLT_REUSE_DTD) | 287 #if (NGX_HTTP_XSLT_REUSE_DTD) |
288 ctx->doc->extSubset = NULL; | 288 ctx->doc->extSubset = NULL; |
425 | 425 |
426 ctx->ctxt = ctxt; | 426 ctx->ctxt = ctxt; |
427 ctx->request = r; | 427 ctx->request = r; |
428 } | 428 } |
429 | 429 |
430 err = xmlParseChunk(ctx->ctxt, (char *) b->pos, | 430 err = xmlParseChunk(ctx->ctxt, (char *) b->pos, (int) (b->last - b->pos), |
431 (int) (b->last - b->pos), b->last_buf); | 431 (b->last_buf) || (b->last_in_chain)); |
432 | 432 |
433 if (err == 0) { | 433 if (err == 0) { |
434 b->pos = b->last; | 434 b->pos = b->last; |
435 return NGX_OK; | 435 return NGX_OK; |
436 } | 436 } |
810 } | 810 } |
811 | 811 |
812 b->pos = buf; | 812 b->pos = buf; |
813 b->last = buf + len; | 813 b->last = buf + len; |
814 b->memory = 1; | 814 b->memory = 1; |
815 b->last_buf = 1; | |
816 | 815 |
817 if (encoding) { | 816 if (encoding) { |
818 r->headers_out.charset.len = ngx_strlen(encoding); | 817 r->headers_out.charset.len = ngx_strlen(encoding); |
819 r->headers_out.charset.data = encoding; | 818 r->headers_out.charset.data = encoding; |
820 } | 819 } |
821 | 820 |
822 if (r != r->main) { | 821 if (r != r->main) { |
823 return b; | 822 return b; |
824 } | 823 } |
824 | |
825 b->last_buf = 1; | |
825 | 826 |
826 if (type) { | 827 if (type) { |
827 len = ngx_strlen(type); | 828 len = ngx_strlen(type); |
828 | 829 |
829 r->headers_out.content_type_len = len; | 830 r->headers_out.content_type_len = len; |