diff --git a/drupal/modules/update/update.fetch.inc b/drupal/modules/update/update.fetch.inc index 22db6e8..208d351 100644 --- a/drupal/modules/update/update.fetch.inc +++ b/drupal/modules/update/update.fetch.inc @@ -23,6 +23,7 @@ function update_manual_status() { * Fetch project info via XML from a central server. */ function _update_refresh() { + static $fail = 0; global $base_url; module_load_include('inc', 'update', 'update.compare'); @@ -47,9 +48,17 @@ function _update_refresh() { foreach ($projects as $key => $project) { $url = _update_build_fetch_url($project, $site_key); - $xml = drupal_http_request($url); - if (isset($xml->data)) { - $data[] = $xml->data; + if ($fail < UPDATE_TRIES) { + $xml = drupal_http_request($url); + if (isset($xml->data)) { + $data[] = $xml->data; + // connection is good + $fail = 0; + } + else { + // connection likely broken; prepare to give up + $fail++; + } } } diff --git a/drupal/modules/update/update.module b/drupal/modules/update/update.module index f173d65..a58e958 100644 --- a/drupal/modules/update/update.module +++ b/drupal/modules/update/update.module @@ -51,6 +51,10 @@ define('UPDATE_NOT_CHECKED', -1); */ define('UPDATE_UNKNOWN', -2); +/** + * Number of tries to conclude connection between site and drupal.org broken. + */ +define('UPDATE_TRIES', 2); /** * Implementation of hook_help().