Commits

Laurence Rowe committed 151124d

Set done flag on module context to stop further chunk parsing.

As HTML parsing will recover from non-fatal errors, the return value of
(x|ht)mlParseChunk cannot be used.

Comments (0)

Files changed (1)

src/http/modules/ngx_http_xslt_filter_module.c

     err = xmlParseChunk(ctx->ctxt, (char *) b->pos, (int) (b->last - b->pos),
                         (b->last_buf) || (b->last_in_chain));
 
-    if (err == 0) {
+    if (ctx->done == 0) {
         b->pos = b->last;
         return NGX_OK;
     }
 
     ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,
                   "libxml2 error: \"%*s\"", n + 1, buf);
+
+    ctx->done = 1; /* stop further chunk parsing */
 }