diff options
author | Brion Vibber <brion@pobox.com> | 2010-01-20 08:37:58 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-01-20 08:37:58 -0800 |
commit | 906450e2f5b78a1c6f2dec2e21b9b5841df210f4 (patch) | |
tree | b5db8e18b697ad2528387359074b47363c4709d5 /extlib/XMPPHP | |
parent | 71df23642c60d24669def858a8059d70f284744c (diff) |
DEBUG HACK: error checking for xml_parse in XMPPHP input stream
Diffstat (limited to 'extlib/XMPPHP')
-rw-r--r-- | extlib/XMPPHP/XMLStream.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/extlib/XMPPHP/XMLStream.php b/extlib/XMPPHP/XMLStream.php index d33411ec5..dbc4719e4 100644 --- a/extlib/XMPPHP/XMLStream.php +++ b/extlib/XMPPHP/XMLStream.php @@ -417,7 +417,12 @@ class XMPPHP_XMLStream { } } $this->log->log("RECV: $buff", XMPPHP_Log::LEVEL_VERBOSE); - xml_parse($this->parser, $buff, false); + $ok = xml_parse($this->parser, $buff, false); + if (!$ok) { + $errcode = xml_get_error_code($this->parser); + $errstr = xml_error_string($errcode); + $this->log->log("XML ERROR: $errstr", XMPPHP_Log::LEVEL_VERBOSE); + } } else { # $updated == 0 means no changes during timeout. } @@ -671,7 +676,12 @@ class XMPPHP_XMLStream { } } $this->log->log("RECV: $buff", XMPPHP_Log::LEVEL_VERBOSE); - xml_parse($this->parser, $buff, false); + $ok = xml_parse($this->parser, $buff, false); + if (!$ok) { + $errcode = xml_get_error_code($this->parser); + $errstr = xml_error_string($errcode); + $this->log->log("XML ERROR: $errstr", XMPPHP_Log::LEVEL_VERBOSE); + } } /** |