Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.2.2

Bug #11560 Timeout of pingback server not handled
Submitted: 2007-07-08 06:30 UTC
From: domster Assigned: firman
Status: Closed Package: Services_Pingback (version 0.2.1)
PHP Version: 5.2.3 OS: Any
Roadmaps: (Not assigned)    
Subscription  


 [2007-07-08 06:30 UTC] domster (Dominic Scheirlinck)
Description: ------------ Services_Pingback sends a ping XML_RPC message without setting a timeout. You can see this at around line 577 of Pingback.php: $res = $cli->send($msg); The documentation for XML_RPC mentions that if a timeout is not passed to the send method then no timeout is used (the default is to wait forever). This means that if the pingback server doesn't respond (more specifically, if a socket can't be opened), Services_Pingback will not return from its send method. The PHP max_execution_time value will be hit, if there is one. And, importantly, no error is returned, making this problem hard for end users to debug. Test script: --------------- <?php include 'Services/Pingback.php'; $ping = new Services_Pingback(); $ping->set('sourceURI', 'http://example.org/source'); $ping->set('targetURI', 'http://example.org/target'); /* Set this url to a server that is up but does not have port 80 open. Putting one of the example.* sites here will not reproduce the bug, because they have port 80 open. I recommend a machine on your local network that you know is not running a webserver. */ $ping->set('pingbackURI', 'http://someserver.test/'); $result = $ping->send(); if (PEAR::isError($result)) { die($result->getMessage()); } ?> Expected result: ---------------- A nice error, explaining that a socket to the pingback server could not be opened, or that a timeout occurred. Actual result: -------------- Nothing. Execution does not reach the if block.

Comments

 [2007-07-09 10:55 UTC] firman (Firman Wandayandi)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.