dns: Reduce ttls
[sks-keyservers-pool.git] / sks-keyservers.net / status-srv / sks_get_srv_measurement.php
blobd4beeac5998debe1edb73beb62e4d5fd41dbbd26
1 <?php
2 /*
3 * status-srv/sks_get_srv_measurement.php
4 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Kristian Fiskerstrand
5 *
6 * This file is part of SKS Keyserver Pool (http://sks-keyservers.net)
7 *
8 * The Author can be reached by electronic mail at kf@sumptuouscapital.com
9 * Communication using OpenPGP is preferred - a copy of the public key 0x0B7F8B60E3EDFAE3
10 * is available in all the common keyservers or in hkp://pool.sks-keyservers.net
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
27 * argv[1] is URL of retrieval check
30 if(!isset($argv[1]))
31 die("Missing argument");
34 * Force sleep at random interval to spread load
35 */
37 sleep(rand(1,15));
39 $ch = curl_init("{$argv[1]}");
40 curl_setopt($ch, CURLOPT_HEADER, 0);
41 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
42 curl_setopt($ch, CURLOPT_TIMEOUT, 20);
43 if(($ret=curl_exec($ch))===FALSE)
45 curl_close($ch);
47 else
49 curl_close($ch);
50 echo $ret;