Skip to content

Commit

Permalink
Merge branch 'release/v0.2.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
betterthanclay committed Nov 28, 2023
2 parents 2784be3 + 3e3e0ab commit 6afa002
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v0.2.11 (2023-11-28)
* Improved ob_flush handling in transport

## v0.2.10 (2023-11-26)
* Added parameter support to deferred stages

Expand Down
1 change: 1 addition & 0 deletions src/Message/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function __construct(
iterable|Closure $iterator,
bool $buffer = true
) {
/** @phpstan-ignore-next-line */
$this->iterator = (function () use ($iterator) {
if ($iterator instanceof Closure) {
$this->fiber = new Fiber($iterator);
Expand Down
8 changes: 4 additions & 4 deletions src/Transport/Generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,11 @@ protected function sendBody(
$stream->rewind();
}

while (ob_get_level() > 0) {
ob_end_clean();
}

flush();
ob_flush();
set_time_limit(0);

$isChunked = $this->manualChunk ?
Expand All @@ -174,19 +177,16 @@ protected function sendBody(
echo dechex(strlen($chunk)) . "\r\n";
echo $chunk . "\r\n";
flush();
ob_flush();
} else {
echo $chunk;
flush();
ob_flush();
}
}

// Send end chunk
if ($isChunked) {
echo "0\r\n\r\n";
flush();
ob_flush();
}
}
}

0 comments on commit 6afa002

Please sign in to comment.