Skip to content

Commit b345e90

Browse files
committed
[http client] php5.3 fix
1 parent f16ab33 commit b345e90

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Client/Request.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ public function writeHead()
5353
$that = $this;
5454
$request = $this->request;
5555
$streamRef = &$this->stream;
56+
$stateRef = &$this->state;
5657

57-
$this->connect(function($stream, \Exception $error = null) use ($that, $request, &$streamRef) {
58+
$this->connect(function($stream, \Exception $error = null) use ($that, $request, &$streamRef, &$stateRef) {
5859
if (!$stream) {
5960
$that->closeError(new \RuntimeException(
6061
"connection failed",
@@ -76,7 +77,7 @@ public function writeHead()
7677

7778
$stream->write($headers);
7879

79-
$this->state = self::STATE_HEAD_WRITTEN;
80+
$stateRef = Request::STATE_HEAD_WRITTEN;
8081

8182
$that->emit('headers-written', array($that));
8283
});

0 commit comments

Comments
 (0)