From d164643a3560174bf1caabef4649b5b2a382b8ff Mon Sep 17 00:00:00 2001 From: jim-p Date: Sun, 13 Feb 2011 11:14:26 -0500 Subject: Make update check a little more robust. Timeout after a few seconds, and if we get a non-200 http code, ignore the response. --- usr/local/www/widgets/widgets/system_information.widget.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/local/www/widgets/widgets/system_information.widget.php') diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php index 90dcb36..c5f63ce 100644 --- a/usr/local/www/widgets/widgets/system_information.widget.php +++ b/usr/local/www/widgets/widgets/system_information.widget.php @@ -49,9 +49,9 @@ if($_REQUEST['getupdatestatus']) { } @unlink("/tmp/{$g['product_name']}_version"); - download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version"); + if (download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version", 5, 5)) + $remote_version = trim(@file_get_contents("/tmp/{$g['product_name']}_version")); - $remote_version = trim(@file_get_contents("/tmp/{$g['product_name']}_version")); if(empty($remote_version)) echo "

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