Permalink
Browse files

[Http] Perf tweak to parsing the start line of a HTTP response

  • Loading branch information...
1 parent 199f88f commit cf4ee671245e591575c7f390734ecb511a00b98e @mtdowling mtdowling committed Aug 25, 2012
Showing with 3 additions and 7 deletions.
  1. +3 −7 Message/Request.php
View
@@ -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.

0 comments on commit cf4ee67

Please sign in to comment.