DEBUG HACK: error checking for xml_parse in XMPPHP input stream

This commit is contained in:
Brion Vibber 2010-01-20 08:37:58 -08:00
parent 71df23642c
commit 906450e2f5

View File

@ -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);
}
}
/**