Permalink
Browse files

Bug #10788 Net_Ping::ping() multiple calls pile up output in results …

…buffer

Patch by Craig Constantine (cconstantine)


git-svn-id: http://svn.php.net/repository/pear/packages/Net_Ping/trunk@237048 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent e702005 commit a8ff6bab95dd42f2287932be5682db11ee7eeb5d @helgi helgi committed Jun 5, 2007
Showing with 7 additions and 0 deletions.
  1. +7 −0 Ping.php
View
@@ -346,6 +346,13 @@ function ping($host)
$argList = $this->_createArgList();
$cmd = $this->_ping_path." ".$argList['pre']." ".$host." ".$argList['post'];
+
+ // since we return a new instance of Net_Ping_Result (on
+ // success), users may call the ping() method repeatedly to
+ // perform unrelated ping tests Make sure we don't have raw data
+ // from a previous call laying in the _result array.
+ $this->_result = array();
+
exec($cmd, $this->_result);
if (!is_array($this->_result)) {

0 comments on commit a8ff6ba

Please sign in to comment.