Commit ce6eab6d authored by dmorley's avatar dmorley

do better when no connection to pod

parent 2402c1a9
......@@ -107,9 +107,9 @@ while ($row = pg_fetch_all($result)) {
curl_setopt($chss, CURLOPT_URL, "https://".$domain."/nodeinfo/1.0");
curl_setopt($chss, CURLOPT_POST, 0);
curl_setopt($chss, CURLOPT_HEADER, 0);
curl_setopt($chss, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($chss, CURLOPT_TIMEOUT, 15);
curl_setopt($chss, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($chss, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($chss, CURLOPT_TIMEOUT, 9);
curl_setopt($chss, CURLOPT_RETURNTRANSFER, 5);
curl_setopt($chss, CURLOPT_NOBODY, 0);
$outputssl = curl_exec($chss);
curl_close($chss);
......@@ -118,14 +118,15 @@ while ($row = pg_fetch_all($result)) {
curl_setopt($ch, CURLOPT_URL, "http://".$domain."/nodeinfo/1.0");
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 0);
$output = curl_exec($ch);
curl_close($ch);
if ($debug) {echo "not-e"; print $output;}
if ($debug) {echo "e"; var_dump($outputssl);}
if (!$output && !$outpulssl && !$domain) {continue;echo "no connection to pod";}
if ($outputssl) {$secure="true";$outputresults=$outputssl;} elseif ($output) {$secure="false";$outputresults=$output;}
if (stristr($outputresults, 'openRegistrations')) {
$score = $score +1;
......
......@@ -34,4 +34,5 @@ if ($uptr->monitors[0]->status == 9) {$live = "Down";}
echo "Status: ".$live;
pg_free_result($result);
pg_close($dbh);
?>
......@@ -114,7 +114,7 @@ EOF;
Data last refreshed at: <?php echo date("F d Y H:i:s.", filemtime($lastfile)) ?> Pacific Time<br>
Want more stats? <a href="https://the-federation.info/">https://the-federation.info/</a> | <a href="https://diapod.net/active/">https://diapod.net/active/</a><br>
Poduptime is open source on <a href="https://github.com/diasporg/Poduptime">GitHub</a> Feel free to contribute with pull requests or bug reports!<br>
Questions on how this site works? <a href="https://github.com/diasporg/Poduptime/wiki">Wiki</a><br>
Questions on how this site works? <a href="https://github.com/diasporg/Poduptime/wiki">Wiki</a> | <a href="https://dia.so/support">Contact</a><br>
<a href="https://diasporafoundation.org/">More about Diaspora</a><br><a href="http://friendica.com/">More about Friendica</a><br><a href="http://hubzilla.org/">More about Hubzilla(redmatrix)</a>
</div>
<div id="howto" style="display:none; margin-left:50px">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment