Skip to content

Commit

Permalink
[HttpClient] fix offset computation for data chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Jun 10, 2020
1 parent c70241e commit ff05be0
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 ff05be0

Please sign in to comment.