+ $bits = explode(' ', $line, 3);
+ if (count($bits) != 3) {
+ throw new Exception("Invalid HTTP response line: $line");
+ }
+
+ list($http, $status, $text) = $bits;
+ if (substr($http, 0, 5) != 'HTTP/') {
+ throw new Exception("Invalid HTTP response line chunk '$http': $line");
+ }
+ if ($status != '200') {
+ throw new Exception("Bad HTTP response code $status: $line");
+ }
+ common_log(LOG_DEBUG, "$this->id $line");