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

Bug #2559 Error handling ping output
Submitted: 2004-10-18 14:23 UTC
From: johann dot hoehn at ecommerce dot com Assigned: cconstantine
Status: Closed Package: Net_Ping
PHP Version: 4.3.9 OS: Linux (Fedora Core 2)
Roadmaps: 2.4.3    
Subscription  


 [2004-10-18 14:23 UTC] johann dot hoehn at ecommerce dot com
Description: ------------ It seems for some reason when Net_Ping executes the ping command it is not capturing stderr at all. This results in some notice messages about $parts being undefined in the function _parseResultlinux(). In _parseResultLinux is automatically subtracts 4 from the line length which can result in the for loop not being triggered and the $parts will be undefined. This can happen when several of the ping packets are blocked causing the output to being signafically less than the function expects. For example, trying to ping www.microsoft.com results in 5 lines of output and the function will fail the for loop causing $parts to be undefined. Reproduce code: --------------- function _parseResultlinux() { ... print_r($this->_raw_data); ... } Actual result: -------------- Array ( [0] => PING www.microsoft.com.nsatc.net (207.46.144.188) 32(60) bytes of data. [1] => [2] => --- www.microsoft.com.nsatc.net ping statistics --- [3] => 4 packets transmitted, 0 received, 100% packet loss, time 3009ms [4] => )

Comments

 [2007-05-11 03:05 UTC] cconstantine (Craig Constantine)
I'm working on a patch to overhaul the output parser. See related bug #758
 [2007-12-27 23:04 UTC] cconstantine (Craig Constantine)
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.