Mercurial > hg > nginx
changeset 3096:8ba95d7cab37 stable-0.7
merge r2984, r2985, r3000:
XSLT filter fixes:
*) preserve XML wellFormed field before freeing memory
*) fix libxml2 error message
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 07 Sep 2009 10:05:36 +0000 |
parents | e326a69cabc9 |
children | 8393cadef25d |
files | src/http/modules/ngx_http_xslt_filter_module.c |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_xslt_filter_module.c Mon Sep 07 10:03:15 2009 +0000 +++ b/src/http/modules/ngx_http_xslt_filter_module.c Mon Sep 07 10:05:36 2009 +0000 @@ -194,7 +194,7 @@ NULL, /* init process */ NULL, /* init thread */ NULL, /* exit thread */ - ngx_http_xslt_filter_exit, /* exit process */ + ngx_http_xslt_filter_exit, /* exit process */ ngx_http_xslt_filter_exit, /* exit master */ NGX_MODULE_V1_PADDING }; @@ -247,6 +247,7 @@ static ngx_int_t ngx_http_xslt_body_filter(ngx_http_request_t *r, ngx_chain_t *in) { + int wellFormed; ngx_chain_t *cl; ngx_http_xslt_filter_ctx_t *ctx; @@ -288,9 +289,11 @@ ctx->doc->extSubset = NULL; #endif + wellFormed = ctx->ctxt->wellFormed; + xmlFreeParserCtxt(ctx->ctxt); - if (ctx->ctxt->wellFormed) { + if (wellFormed) { return ngx_http_xslt_send(r, ctx, ngx_http_xslt_apply_stylesheet(r, ctx)); } @@ -717,7 +720,7 @@ while (--n && (buf[n] == CR || buf[n] == LF)) { /* void */ } ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, - "libxml2 error: \"%*s\"", n, buf); + "libxml2 error: \"%*s\"", n + 1, buf); }