Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.1103 diff -u -p -r1.1103 common.inc --- includes/common.inc 10 Feb 2010 20:22:57 -0000 1.1103 +++ includes/common.inc 12 Feb 2010 02:13:16 -0000 @@ -832,6 +832,12 @@ function drupal_http_request($url, array // Make sure the socket opened properly. if (!$fp) { + if (!$errno) { + $result->error = 'socket not initialized'; + $result->code = -1004; + return $result; + } + // When a network error occurs, we use a negative number so it does not // clash with the HTTP status codes. $result->code = -$errno;