Skip to content

Commit

Permalink
[Http] Perf tweak to parsing the start line of a HTTP response
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdowling committed Aug 25, 2012
1 parent 199f88f commit cf4ee67
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Message/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,9 @@ public function receiveResponseHeader($data)

if (strpos($data, 'HTTP/') === 0) {

$statusLine = explode(' ', $data, 3);
if (isset($statusLine[2])) {
list( , $code, $status) = $statusLine;
} else {
$code = $statusLine[1];
$status = '';
}
$startLine = explode(' ', $data, 3);
$code = $startLine[1];
$status = isset($startLine[2]) ? $startLine[2] : '';

// Only download the body of the response to the specified response
// body when a successful response is received.
Expand Down

0 comments on commit cf4ee67

Please sign in to comment.