]> git.pld-linux.org Git - packages/cacti.git/blame - ping.patch
- Add patch from date 2010/07/27 more info http://www.cacti.net/download_patches.php
[packages/cacti.git] / ping.patch
CommitLineData
a60f27b1
JS
1diff -ruBbd cacti-0.8.7g/lib/ping.php cacti-0.8.7g-patched/lib/ping.php
2--- cacti-0.8.7g/lib/ping.php 2010-07-09 18:33:46.000000000 -0400
3+++ cacti-0.8.7g-patched/lib/ping.php 2010-08-31 20:31:22.000000000 -0400
4@@ -577,12 +577,16 @@
5 switch(socket_select($r = array($this->socket), $w = array($this->socket), $f = array($this->socket), $to_sec, $to_usec)){
6 case 2:
7 /* connection refused */
8- $this->ping_response = "TCP ping connection refused";
9- $this->ping_status = "down";
10+ $this->time = $this->get_time($this->precision);
11+
12+ if (($this->time*1000) <= $this->timeout) {
13+ $this->ping_response = "TCP Ping connection refused (" . $this->time*1000 . " ms)";
14+ $this->ping_status = $this->time*1000;
15+ }
16
17 $this->close_socket();
18
19- return false;
20+ return true; /* "connection refused" says: host is alive (else ping would time out) */
21 case 1:
22 /* connected, so calculate the total time and return */
23 $this->time = $this->get_time($this->precision);
This page took 0.03628 seconds and 4 git commands to generate.