From 355aa195d61cb12f33417487225949cb50d484b4 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 2 Dec 2008 17:06:08 +0000 Subject: 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. --- usr/local/www/widgets/widgets/system_information.widget.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 "

Unable to check for updates."; -- cgit v1.1