Skip to content

Commit

Permalink
bug #37191 [HttpClient] fix offset computation for data chunks (nicol…
Browse files Browse the repository at this point in the history
…as-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix offset computation for data chunks

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

A minor thingy, still a bugfix.

Commits
-------

ff05be0 [HttpClient] fix offset computation for data chunks
  • Loading branch information
fabpot committed Jun 11, 2020
2 parents c70241e + ff05be0 commit 7107080
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Symfony/Component/HttpClient/Response/ResponseTrait.php
Expand Up @@ -359,8 +359,9 @@ public static function stream(iterable $responses, float $timeout = null): \Gene
continue;
}

$response->offset += \strlen($chunk);
$chunkLen = \strlen($chunk);
$chunk = new DataChunk($response->offset, $chunk);
$response->offset += $chunkLen;
} elseif (null === $chunk) {
$e = $multi->handlesActivity[$j][0];
unset($responses[$j], $multi->handlesActivity[$j]);
Expand Down

0 comments on commit 7107080

Please sign in to comment.