Skip to content

Commit

Permalink
Fix borked v3.0.7 release with null pointer access
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Oct 9, 2017
1 parent 1898018 commit 252eb90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
@@ -1,6 +1,10 @@
# Changelog

## 3.0.7
## 3.0.8

- Fixed null pointer access in response handling completely breaking the client.

## 3.0.7 [ borked ]

- Clean references correctly, so unused bodies aren't consumed and the connection is closed.

Expand Down
3 changes: 2 additions & 1 deletion lib/DefaultClient.php
Expand Up @@ -250,6 +250,7 @@ private function doRead(RequestCycle $requestCycle, ClientSocket $socket): \Gene
$parseResult["headers"] = \array_change_key_case($parseResult["headers"], \CASE_LOWER);

$response = $this->finalizeResponse($requestCycle, $parseResult, $connectionInfo);
$shouldCloseSocketAfterResponse = $this->shouldCloseSocketAfterResponse($response);

if ($requestCycle->deferred) {
$deferred = $requestCycle->deferred;
Expand Down Expand Up @@ -293,7 +294,7 @@ private function doRead(RequestCycle $requestCycle, ClientSocket $socket): \Gene
}
}

if ($this->shouldCloseSocketAfterResponse($response)) {
if ($shouldCloseSocketAfterResponse) {
$this->socketPool->clear($socket);
$socket->close();
} else {
Expand Down

0 comments on commit 252eb90

Please sign in to comment.