Skip to content

Commit

Permalink
Align server window handling in handleHeaders with handleData
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Sep 3, 2023
1 parent 884e367 commit 9899959
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/Driver/Http2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -1052,15 +1052,9 @@ function (int $bodySize) use ($streamId) {
}
);

$bodySizeLimit = $this->bodySizeLimit;

if ($this->serverWindow <= $bodySizeLimit >> 1) {
$increment = \min($bodySizeLimit - $this->serverWindow, self::MAX_INCREMENT);

if ($increment > 0) {
$this->serverWindow += $increment;
$this->writeFrame(\pack("N", $increment), Http2Parser::WINDOW_UPDATE, Http2Parser::NO_FLAG);
}
if ($this->serverWindow <= self::MINIMUM_WINDOW) {
$this->serverWindow += self::MAX_INCREMENT;
$this->writeFrame(\pack("N", self::MAX_INCREMENT), Http2Parser::WINDOW_UPDATE, Http2Parser::NO_FLAG);
}

if (isset($headers["content-length"])) {
Expand Down

0 comments on commit 9899959

Please sign in to comment.