Skip to content

Commit

Permalink
Merge branch 'yurevichcv-feature/body-stream-fixes' into 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
akrabat committed Jul 27, 2015
2 parents d13a44b + 74c9e19 commit cc0017a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Slim/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,12 @@ public function respond(ResponseInterface $response)
$settings = $this->container->get('settings');
while (!$body->eof()) {
echo $body->read($settings['responseChunkSize']);
if (connection_status() != CONNECTION_NORMAL) {
break;
}
}
}

$responded = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Slim/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
$response->getBody()->write($newResponse);
}

if (isset($output)) {
if (!empty($output)) {
if ($this->outputBuffering === 'prepend') {
// prepend output buffer content
$body = new Http\Body(fopen('php://temp', 'r+'));
Expand Down

0 comments on commit cc0017a

Please sign in to comment.