From 05e9e7cf31fe78a2dcf66719b8aef555354daf54 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Mon, 25 Nov 2019 09:19:34 -0300 Subject: [PATCH] XML: Remove error messages from stderr --- CHANGES | 2 ++ src/request_body_processor/xml.cc | 3 +++ src/request_body_processor/xml.h | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/CHANGES b/CHANGES index e3df99a3..bb8802d7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ v3.0.4 - YYYY-MMM-DD (to be released) ------------------------------------- + - XML: Remove error messages from stderr + [Issue #2010 - @JaiHarpalani, @zimmerle] - Filter comment or blank line for pmFromFile operator [Issue #1645 - @LeeShan87, @victorhora, @tdoubley] - Additional adjustment to Cookie header parsing diff --git a/src/request_body_processor/xml.cc b/src/request_body_processor/xml.cc index 70796e65..9483a0f4 100644 --- a/src/request_body_processor/xml.cc +++ b/src/request_body_processor/xml.cc @@ -99,6 +99,9 @@ bool XML::processChunk(const char *buf, unsigned int size, error->assign("XML: Failed to create parsing context."); return false; } + + xmlSetGenericErrorFunc(m_data.parsing_ctx, null_error); + return true; } diff --git a/src/request_body_processor/xml.h b/src/request_body_processor/xml.h index 465cc111..78d8355d 100644 --- a/src/request_body_processor/xml.h +++ b/src/request_body_processor/xml.h @@ -53,6 +53,10 @@ class XML { static xmlParserInputBufferPtr unloadExternalEntity(const char *URI, xmlCharEncoding enc); + static void null_error(void *ctx, const char *msg, ...) { + } + + xml_data m_data; private: