Index: includes/common.inc =================================================================== RCS file: /Users/Shared/code/drupal/includes/common.inc,v retrieving revision 1.847 diff -u -p -r1.847 common.inc --- includes/common.inc 14 Jan 2009 12:18:37 -0000 1.847 +++ includes/common.inc 14 Jan 2009 15:25:35 -0000 @@ -459,23 +459,7 @@ function drupal_access_denied() { function drupal_http_request($url, array $options = array()) { global $db_prefix; - static $self_test = FALSE; $result = new stdClass(); - // Try to clear the drupal_http_request_fails variable if it's set. We - // can't tie this call to any error because there is no surefire way to - // tell whether a request has failed, so we add the check to places where - // some parsing has failed. - if (!$self_test && variable_get('drupal_http_request_fails', FALSE)) { - $self_test = TRUE; - $works = module_invoke('system', 'check_http_request'); - $self_test = FALSE; - if (!$works) { - // Do not bother with further operations if we already know that we - // have no chance. - $result->error = t("The server can't issue HTTP requests"); - return $result; - } - } // Parse the URL and make sure we can handle the schema. $uri = @parse_url($url); @@ -513,6 +497,13 @@ function drupal_http_request($url, array // clash with the HTTP status codes. $result->code = -$errno; $result->error = trim($errstr); + + // Mark that this request failed. This will trigger a check of the web + // server's ability to make outgoing HTTP requests the next time that + // requirements checking is performed. + // @see system_requirements() + variable_set('drupal_http_request_fails', TRUE); + return $result; } Index: includes/xmlrpc.inc =================================================================== RCS file: /Users/Shared/code/drupal/includes/xmlrpc.inc,v retrieving revision 1.55 diff -u -p -r1.55 xmlrpc.inc --- includes/xmlrpc.inc 26 Dec 2008 21:01:57 -0000 1.55 +++ includes/xmlrpc.inc 14 Jan 2009 15:24:26 -0000 @@ -349,7 +349,6 @@ function xmlrpc_error($code = NULL, $mes $xmlrpc_error->is_error = TRUE; $xmlrpc_error->code = $code; $xmlrpc_error->message = $message; - module_invoke('system', 'check_http_request'); } return $xmlrpc_error; } Index: modules/aggregator/aggregator.fetcher.inc =================================================================== RCS file: /Users/Shared/code/drupal/modules/aggregator/aggregator.fetcher.inc,v retrieving revision 1.2 diff -u -p -r1.2 aggregator.fetcher.inc --- modules/aggregator/aggregator.fetcher.inc 26 Dec 2008 21:01:57 -0000 1.2 +++ modules/aggregator/aggregator.fetcher.inc 14 Jan 2009 15:24:26 -0000 @@ -76,6 +76,5 @@ function aggregator_aggregator_fetch($fe default: watchdog('aggregator', 'The feed from %site seems to be broken, due to "%error".', array('%site' => $feed->title, '%error' => $result->code . ' ' . $result->error), WATCHDOG_WARNING); drupal_set_message(t('The feed from %site seems to be broken, because of error "%error".', array('%site' => $feed->title, '%error' => $result->code . ' ' . $result->error))); - module_invoke('system', 'check_http_request'); } } Index: modules/openid/openid.module =================================================================== RCS file: /Users/Shared/code/drupal/modules/openid/openid.module,v retrieving revision 1.35 diff -u -p -r1.35 openid.module --- modules/openid/openid.module 30 Dec 2008 16:43:18 -0000 1.35 +++ modules/openid/openid.module 14 Jan 2009 15:24:26 -0000 @@ -316,9 +316,6 @@ function openid_discovery($claimed_id) { } } } - if (!$services) { - module_invoke('system', 'check_http_request'); - } return $services; } @@ -354,13 +351,11 @@ function openid_association($op_endpoint ); $assoc_result = drupal_http_request($op_endpoint, $assoc_options); if (isset($assoc_result->error)) { - module_invoke('system', 'check_http_request'); return FALSE; } $assoc_response = _openid_parse_message($assoc_result->data); if (isset($assoc_response['mode']) && $assoc_response['mode'] == 'error') { - module_invoke('system', 'check_http_request'); return FALSE; } @@ -529,8 +524,5 @@ function openid_verify_assertion($op_end } } } - if (!$valid) { - module_invoke('system', 'check_http_request'); - } return $valid; } Index: modules/system/system.install =================================================================== RCS file: /Users/Shared/code/drupal/modules/system/system.install,v retrieving revision 1.296 diff -u -p -r1.296 system.install --- modules/system/system.install 9 Jan 2009 16:19:55 -0000 1.296 +++ modules/system/system.install 14 Jan 2009 15:24:26 -0000 @@ -269,12 +269,12 @@ function system_requirements($phase) { $requirements['update status'] = array( 'value' => $t('Enabled'), ); - if (variable_get('drupal_http_request_fails', FALSE)) { + if (variable_get('drupal_http_request_fails', FALSE) && !system_check_http_request()) { $requirements['http requests'] = array( 'title' => $t('HTTP request status'), 'value' => $t('Fails'), 'severity' => REQUIREMENT_ERROR, - 'description' => $t('Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services.'), + 'description' => $t('Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services. If you are certain that Drupal can access web pages but you are still seeing this message, you may add $conf[\'drupal_http_request_fails\'] = FALSE; to the bottom of your settings.php file.)'), ); } } Index: modules/system/system.module =================================================================== RCS file: /Users/Shared/code/drupal/modules/system/system.module,v retrieving revision 1.658 diff -u -p -r1.658 system.module --- modules/system/system.module 11 Jan 2009 21:19:18 -0000 1.658 +++ modules/system/system.module 14 Jan 2009 15:24:26 -0000 @@ -2177,12 +2177,14 @@ function system_time_zones($blank = NULL * will contain an error. * * @return - * Whether the www.example.com page can be requested via HTTP. + * TRUE if this installation can issue HTTP requests. */ function system_check_http_request() { - $result = drupal_http_request('http://www.example.com'); - // If the resulting page contains RFC 2606 then we got the page we wanted. - $works = isset($result->data) && preg_match('/RFC\s+2606/', $result->data); + // Try to get the content of the front page via drupal_http_request() . + $result = drupal_http_request(url('', array('absolute' => TRUE))); + // We only care that we get a http response - this means that Drupal + // can make a http request. + $works = isset($result->code) && ($result->code >= 100 || $result->code < 600); variable_set('drupal_http_request_fails', !$works); return $works; } Index: modules/update/update.fetch.inc =================================================================== RCS file: /Users/Shared/code/drupal/modules/update/update.fetch.inc,v retrieving revision 1.14 diff -u -p -r1.14 update.fetch.inc --- modules/update/update.fetch.inc 30 Dec 2008 16:43:19 -0000 1.14 +++ modules/update/update.fetch.inc 14 Jan 2009 15:24:26 -0000 @@ -56,7 +56,6 @@ function _update_refresh() { watchdog('update', 'Fetched information about all available new releases and updates.', array(), WATCHDOG_NOTICE, l(t('view'), 'admin/reports/updates')); } else { - module_invoke('system', 'check_http_request'); watchdog('update', 'Unable to fetch any information about available new releases and updates.', array(), WATCHDOG_ERROR, l(t('view'), 'admin/reports/updates')); } return $available;