summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc23
-rw-r--r--includes/xmlrpc.inc1
2 files changed, 7 insertions, 17 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 8de8894e3..6946fa02a 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -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 $options = 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;
}
diff --git a/includes/xmlrpc.inc b/includes/xmlrpc.inc
index 4964838ee..7dbb0665b 100644
--- a/includes/xmlrpc.inc
+++ b/includes/xmlrpc.inc
@@ -349,7 +349,6 @@ function xmlrpc_error($code = NULL, $message = NULL) {
$xmlrpc_error->is_error = TRUE;
$xmlrpc_error->code = $code;
$xmlrpc_error->message = $message;
- module_invoke('system', 'check_http_request');
}
return $xmlrpc_error;
}