summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-04-11 23:34:42 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-04-11 23:34:42 +0200
commitd2a7fd129a8d4bac6959425bdfab21095bed082b (patch)
tree75760fcd1e1aefee7e3616be23a6292aae441813 /src
parentf00f5c3ffbc72652568c75de6e48e41b3275fb0a (diff)
downloadbiboumi-d2a7fd129a8d4bac6959425bdfab21095bed082b.tar.gz
biboumi-d2a7fd129a8d4bac6959425bdfab21095bed082b.tar.bz2
biboumi-d2a7fd129a8d4bac6959425bdfab21095bed082b.tar.xz
biboumi-d2a7fd129a8d4bac6959425bdfab21095bed082b.zip
Do not print an error message from expat if the error was "parsing finished"
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/xmpp_parser.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/xmpp/xmpp_parser.cpp b/src/xmpp/xmpp_parser.cpp
index 536d9da..6bb0d28 100644
--- a/src/xmpp/xmpp_parser.cpp
+++ b/src/xmpp/xmpp_parser.cpp
@@ -55,7 +55,8 @@ XmppParser::~XmppParser()
int XmppParser::feed(const char* data, const int len, const bool is_final)
{
int res = XML_Parse(this->parser, data, len, is_final);
- if (res == 0)
+ if (res == XML_STATUS_ERROR &&
+ (XML_GetErrorCode(this->parser) != XML_ERROR_FINISHED))
log_error("Xml_Parse encountered an error: " <<
XML_ErrorString(XML_GetErrorCode(this->parser)))
return res;
@@ -64,7 +65,7 @@ int XmppParser::feed(const char* data, const int len, const bool is_final)
int XmppParser::parse(const int len, const bool is_final)
{
int res = XML_ParseBuffer(this->parser, len, is_final);
- if (res == 0)
+ if (res == XML_STATUS_ERROR)
log_error("Xml_Parsebuffer encountered an error: " <<
XML_ErrorString(XML_GetErrorCode(this->parser)));
return res;