#24826 [Ana->Asn]: PEAR::Net Ping Bug

From: Date: Sun, 27 Jul 2003 10:43:11 +0000
Subject: #24826 [Ana->Asn]: PEAR::Net Ping Bug
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-18776@lists.php.net to get a copy of this message
ID: 24826 Updated by: arnaud@php.net Reported By: young at sl dot com dot ua -Status: Analyzed +Status: Assigned Bug Type: PEAR related Operating System: Linux PHP Version: 4.3.2 -Assigned To: +Assigned To: mj Previous Comments: ------------------------------------------------------------------------ [2003-07-27 04:29:48] nicos@php.net Here is the patch... Is it ok? cvs server: Diffing . Index: Ping.php =================================================================== RCS file: /repository/pear/Net_Ping/Ping.php,v retrieving revision 1.25 diff -u -u -r1.25 Ping.php --- Ping.php 14 Jul 2003 20:26:55 -0000 1.25 +++ Ping.php 27 Jul 2003 09:28:27 -0000 @@ -606,13 +606,14 @@ /* if mdev field exists, shift input one unit left */ if (strpos($this->_raw_data[$raw_data_len - 1], 'mdev')) { + /* do not forget the rtt field */ + $this->_round_trip['min'] = ltrim($round_trip[5]); + $this->_round_trip['avg'] = $round_trip[6]; + $this->_round_trip['max'] = $round_trip[7]; + } else { $this->_round_trip['min'] = ltrim($round_trip[4]); $this->_round_trip['avg'] = $round_trip[5]; $this->_round_trip['max'] = $round_trip[6]; - } else { - $this->_round_trip['min'] = ltrim($round_trip[3]); - $this->_round_trip['avg'] = $round_trip[4]; - $this->_round_trip['max'] = $round_trip[5]; } } ------------------------------------------------------------------------ [2003-07-27 03:13:52] young at sl dot com dot ua Description: ------------ Result object: ----------------------------------------------------------- net_ping_result Object ( [_icmp_sequence] => Array ( [.166):] => 1 ) [_target_ip] => www.example.co [_bytes_per_request] => 64 [_bytes_total] => 704 [_ttl] => _seq=10 [_raw_data] => Array ( [0] => PING example.com (192.0.34.166) 56(84) bytes of data. [1] => 64 bytes from www.example.com (192.0.34.166): icmp_seq=1 ttl=41 time=248 ms [2] => 64 bytes from www.example.com (192.0.34.166): icmp_seq=2 ttl=41 time=231 ms [3] => 64 bytes from www.example.com (192.0.34.166): icmp_seq=3 ttl=41 time=231 ms [4] => 64 bytes from www.example.com (192.0.34.166): icmp_seq=4 ttl=41 time=237 ms [5] => 64 bytes from www.example.com (192.0.34.166): icmp_seq=5 ttl=41 time=238 ms [6] => 64 bytes from www.example.com (192.0.34.166): icmp_seq=6 ttl=41 time=227 ms [7] => 64 bytes from www.example.com (192.0.34.166): icmp_seq=7 ttl=41 time=242 ms [8] => 64 bytes from www.example.com (192.0.34.166): icmp_seq=8 ttl=41 time=249 ms [9] => 64 bytes from www.example.com (192.0.34.166): icmp_seq=9 ttl=41 time=242 ms [10] => 64 bytes from www.example.com (192.0.34.166): icmp_seq=10 ttl=41 time=229 ms [11] => [12] => --- example.com ping statistics --- [13] => 10 packets transmitted, 10 received, 0% packet loss, time 9098ms [14] => rtt min/avg/max/mdev = 227.624/237.838/249.118/7.252 ms ) [_sysname] => linux [_round_trip] => Array ( [min] => mdev [avg] => 227.624 [max] => 237.838 ) [_transmitted] => 10 [_received] => 10 [_loss] => 0 ) ----------------------------------------------------------- Error here: ----------------------------------------------------------- [min] => mdev [avg] => 227.624 [max] => 237.838 ----------------------------------------------------------- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24826&edit=1

« previous php.pear.dev (#18776) next »