diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-12-02 17:06:08 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-12-02 17:06:08 +0000 |
commit | 355aa195d61cb12f33417487225949cb50d484b4 (patch) | |
tree | c7b5302e224a8fd5a5eea098acee5a32a5273872 | |
parent | 22dde6eb2c977d3af2441cde3e0d8e570c06977f (diff) | |
download | pfsense-355aa195d61cb12f33417487225949cb50d484b4.zip pfsense-355aa195d61cb12f33417487225949cb50d484b4.tar.gz |
Use host with a timeout of 1 second to query the update ip address.
If we cannot resolve the IP address within 1 second show that an update
is not available instead of hanging the webConfigurator while waiting
for DNS timeouts.
-rw-r--r-- | usr/local/www/widgets/widgets/system_information.widget.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php index 1774d0b..d65c469 100644 --- a/usr/local/www/widgets/widgets/system_information.widget.php +++ b/usr/local/www/widgets/widgets/system_information.widget.php @@ -61,7 +61,13 @@ $curcfg = $config['system']['firmware']; else $updater_url = $g['update_url']; - $latest_version = download_file_with_progress_bar("{$updater_url}/version", "/tmp/{$g['product_name']}_version"); + /* ensure we can obtain the DNS information quickly */ + $host = split("/", $updater_url); + $test_dns = `/usr/bin/host -W1 {$host[2]} | grep "has address" | awk '{ print $4 }' | wc -l`; + if($test_dns) + $latest_version = download_file_with_progress_bar("{$updater_url}/version", "/tmp/{$g['product_name']}_version"); + else + $latest_version ="404"; if(strstr($latest_version,"404")) { echo "<br /><br />Unable to check for updates."; |