框架升级及修复升级后的bug

This commit is contained in:
Dev
2026-10-16 18:13:09 +08:00
parent dafb0c96c0
commit 2d342bcbd7
537 changed files with 49836 additions and 40933 deletions
@@ -44,8 +44,6 @@ trait TransportResponseTrait
private int|string $id;
private ?float $timeout = 0;
private \InflateContext|bool|null $inflate = null;
private int $inflateIn = 0;
private int $inflateOut = 0;
private ?array $finalInfo = null;
private ?LoggerInterface $logger = null;
private bool $didTimeout = false;
@@ -200,22 +198,9 @@ trait TransportResponseTrait
while ($multi->handlesActivity[$j] ?? false) {
if (\is_string($chunk = array_shift($multi->handlesActivity[$j]))) {
if (null !== $response->inflate) {
$response->inflateIn += \strlen($chunk);
if (false === $chunk = @inflate_add($response->inflate, $chunk)) {
$multi->handlesActivity[$j] = [null, new TransportException(\sprintf('Error while processing content unencoding for "%s".', $response->getInfo('url')))];
continue;
}
$response->inflateOut += \strlen($chunk);
// Reject decompression bombs. The ratio is meaningless on small bodies,
// so it applies only past the 2 MB that php://temp keeps in memory.
if (2097152 < $response->inflateOut && 100 * $response->inflateIn < $response->inflateOut) {
$multi->handlesActivity[$j] = [null, new TransportException(\sprintf('Content of "%s" inflated to more than 100 times its compressed size.', $response->getInfo('url')))];
continue;
}
if (null !== $response->inflate && false === $chunk = @inflate_add($response->inflate, $chunk)) {
$multi->handlesActivity[$j] = [null, new TransportException(\sprintf('Error while processing content unencoding for "%s".', $response->getInfo('url')))];
continue;
}
if ('' !== $chunk && null !== $response->content && \strlen($chunk) !== fwrite($response->content, $chunk)) {