]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
DEBUG HACK: error checking for xml_parse in XMPPHP input stream
authorBrion Vibber <brion@pobox.com>
Wed, 20 Jan 2010 16:37:58 +0000 (08:37 -0800)
committerBrion Vibber <brion@pobox.com>
Wed, 20 Jan 2010 16:37:58 +0000 (08:37 -0800)
extlib/XMPPHP/XMLStream.php

index d33411ec54140dafc1c527c946d05cbc931807c9..dbc4719e427f43bd223504d115d3e44dd427c9f7 100644 (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);
+               }
        }
 
        /**