summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 3aa5f0282..1da216095 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -431,7 +431,10 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
// Make sure the socket opened properly.
if (!$fp) {
- $result->error = trim($errno .' '. $errstr);
+ // When a network error occurs, we make sure that it is a negative
+ // number so it can clash with the HTTP status codes.
+ $result->code = -$errno;
+ $result->error = trim($errstr);
return $result;
}