Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit cf4ee671245e591575c7f390734ecb511a00b98e 1 parent 199f88f
@mtdowling mtdowling authored
Showing with 3 additions and 7 deletions.
  1. +3 −7 Message/Request.php
View
10 Message/Request.php
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.