diff --git a/lam/lib/3rdParty/composer/composer/installed.json b/lam/lib/3rdParty/composer/composer/installed.json index 760ab1dfd..39b54d361 100644 --- a/lam/lib/3rdParty/composer/composer/installed.json +++ b/lam/lib/3rdParty/composer/composer/installed.json @@ -2648,17 +2648,17 @@ }, { "name": "symfony/http-client", - "version": "v6.4.18", - "version_normalized": "6.4.18.0", + "version": "v6.4.19", + "version_normalized": "6.4.19.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "394b440934056b8d9d6ba250001458e9d7998b7f" + "reference": "3294a433fc9d12ae58128174896b5b1822c28dad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/394b440934056b8d9d6ba250001458e9d7998b7f", - "reference": "394b440934056b8d9d6ba250001458e9d7998b7f", + "url": "https://api.github.com/repos/symfony/http-client/zipball/3294a433fc9d12ae58128174896b5b1822c28dad", + "reference": "3294a433fc9d12ae58128174896b5b1822c28dad", "shasum": "" }, "require": { @@ -2693,7 +2693,7 @@ "symfony/process": "^5.4|^6.0|^7.0", "symfony/stopwatch": "^5.4|^6.0|^7.0" }, - "time": "2025-01-28T15:49:13+00:00", + "time": "2025-02-13T09:55:13+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2724,7 +2724,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.4.18" + "source": "https://github.com/symfony/http-client/tree/v6.4.19" }, "funding": [ { diff --git a/lam/lib/3rdParty/composer/composer/installed.php b/lam/lib/3rdParty/composer/composer/installed.php index 5b3a92cf9..10e44254c 100644 --- a/lam/lib/3rdParty/composer/composer/installed.php +++ b/lam/lib/3rdParty/composer/composer/installed.php @@ -408,9 +408,9 @@ 'dev_requirement' => false, ), 'symfony/http-client' => array( - 'pretty_version' => 'v6.4.18', - 'version' => '6.4.18.0', - 'reference' => '394b440934056b8d9d6ba250001458e9d7998b7f', + 'pretty_version' => 'v6.4.19', + 'version' => '6.4.19.0', + 'reference' => '3294a433fc9d12ae58128174896b5b1822c28dad', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-client', 'aliases' => array(), diff --git a/lam/lib/3rdParty/composer/symfony/http-client/CurlHttpClient.php b/lam/lib/3rdParty/composer/symfony/http-client/CurlHttpClient.php index 3e15bef74..31eca9d83 100644 --- a/lam/lib/3rdParty/composer/symfony/http-client/CurlHttpClient.php +++ b/lam/lib/3rdParty/composer/symfony/http-client/CurlHttpClient.php @@ -237,7 +237,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface, if (!\is_string($body)) { if (\is_resource($body)) { - $curlopts[\CURLOPT_INFILE] = $body; + $curlopts[\CURLOPT_READDATA] = $body; } else { $curlopts[\CURLOPT_READFUNCTION] = static function ($ch, $fd, $length) use ($body) { static $eof = false; @@ -316,6 +316,9 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface, } foreach ($curlopts as $opt => $value) { + if (\PHP_INT_SIZE === 8 && \defined('CURLOPT_INFILESIZE_LARGE') && \CURLOPT_INFILESIZE === $opt && $value >= 1 << 31) { + $opt = \CURLOPT_INFILESIZE_LARGE; + } if (null !== $value && !curl_setopt($ch, $opt, $value) && \CURLOPT_CERTINFO !== $opt && (!\defined('CURLOPT_HEADEROPT') || \CURLOPT_HEADEROPT !== $opt)) { $constantName = $this->findConstantName($opt); throw new TransportException(sprintf('Curl option "%s" is not supported.', $constantName ?? $opt)); @@ -472,7 +475,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface, \CURLOPT_RESOLVE => 'resolve', \CURLOPT_NOSIGNAL => 'timeout', \CURLOPT_HTTPHEADER => 'headers', - \CURLOPT_INFILE => 'body', + \CURLOPT_READDATA => 'body', \CURLOPT_READFUNCTION => 'body', \CURLOPT_INFILESIZE => 'body', \CURLOPT_POSTFIELDS => 'body', diff --git a/lam/lib/3rdParty/composer/symfony/http-client/HttpClientTrait.php b/lam/lib/3rdParty/composer/symfony/http-client/HttpClientTrait.php index 89446ff8c..4be9afa79 100644 --- a/lam/lib/3rdParty/composer/symfony/http-client/HttpClientTrait.php +++ b/lam/lib/3rdParty/composer/symfony/http-client/HttpClientTrait.php @@ -356,9 +356,11 @@ trait HttpClientTrait } }); - $body = http_build_query($body, '', '&'); + if ('' === $body = http_build_query($body, '', '&')) { + return ''; + } - if ('' === $body || !$streams && !str_contains($normalizedHeaders['content-type'][0] ?? '', 'multipart/form-data')) { + if (!$streams && !str_contains($normalizedHeaders['content-type'][0] ?? '', 'multipart/form-data')) { if (!str_contains($normalizedHeaders['content-type'][0] ?? '', 'application/x-www-form-urlencoded')) { $normalizedHeaders['content-type'] = ['Content-Type: application/x-www-form-urlencoded']; } diff --git a/lam/lib/3rdParty/composer/symfony/http-client/Response/AmpResponse.php b/lam/lib/3rdParty/composer/symfony/http-client/Response/AmpResponse.php index e01d97eb8..00001ccec 100644 --- a/lam/lib/3rdParty/composer/symfony/http-client/Response/AmpResponse.php +++ b/lam/lib/3rdParty/composer/symfony/http-client/Response/AmpResponse.php @@ -179,19 +179,17 @@ final class AmpResponse implements ResponseInterface, StreamableInterface /** * @param AmpClientState $multi */ - private static function perform(ClientState $multi, ?array &$responses = null): void + private static function perform(ClientState $multi, ?array $responses = null): void { - if ($responses) { - foreach ($responses as $response) { - try { - if ($response->info['start_time']) { - $response->info['total_time'] = microtime(true) - $response->info['start_time']; - ($response->onProgress)(); - } - } catch (\Throwable $e) { - $multi->handlesActivity[$response->id][] = null; - $multi->handlesActivity[$response->id][] = $e; + foreach ($responses ?? [] as $response) { + try { + if ($response->info['start_time']) { + $response->info['total_time'] = microtime(true) - $response->info['start_time']; + ($response->onProgress)(); } + } catch (\Throwable $e) { + $multi->handlesActivity[$response->id][] = null; + $multi->handlesActivity[$response->id][] = $e; } } } diff --git a/lam/lib/3rdParty/composer/symfony/http-client/Response/AsyncResponse.php b/lam/lib/3rdParty/composer/symfony/http-client/Response/AsyncResponse.php index 25f6409b6..7aa16bcb1 100644 --- a/lam/lib/3rdParty/composer/symfony/http-client/Response/AsyncResponse.php +++ b/lam/lib/3rdParty/composer/symfony/http-client/Response/AsyncResponse.php @@ -12,7 +12,6 @@ namespace Symfony\Component\HttpClient\Response; use Symfony\Component\HttpClient\Chunk\ErrorChunk; -use Symfony\Component\HttpClient\Chunk\FirstChunk; use Symfony\Component\HttpClient\Chunk\LastChunk; use Symfony\Component\HttpClient\Exception\TransportException; use Symfony\Contracts\HttpClient\ChunkInterface; @@ -245,7 +244,7 @@ class AsyncResponse implements ResponseInterface, StreamableInterface $wrappedResponses[] = $r->response; if ($r->stream) { - yield from self::passthruStream($response = $r->response, $r, new FirstChunk(), $asyncMap); + yield from self::passthruStream($response = $r->response, $r, $asyncMap, new LastChunk()); if (!isset($asyncMap[$response])) { array_pop($wrappedResponses); @@ -276,15 +275,9 @@ class AsyncResponse implements ResponseInterface, StreamableInterface } if (!$r->passthru) { - if (null !== $chunk->getError() || $chunk->isLast()) { - unset($asyncMap[$response]); - } elseif (null !== $r->content && '' !== ($content = $chunk->getContent()) && \strlen($content) !== fwrite($r->content, $content)) { - $chunk = new ErrorChunk($r->offset, new TransportException(sprintf('Failed writing %d bytes to the response buffer.', \strlen($content)))); - $r->info['error'] = $chunk->getError(); - $r->response->cancel(); - } + $r->stream = (static fn () => yield $chunk)(); + yield from self::passthruStream($response, $r, $asyncMap); - yield $r => $chunk; continue; } @@ -347,13 +340,13 @@ class AsyncResponse implements ResponseInterface, StreamableInterface } $r->stream = $stream; - yield from self::passthruStream($response, $r, null, $asyncMap); + yield from self::passthruStream($response, $r, $asyncMap); } /** * @param \SplObjectStorage|null $asyncMap */ - private static function passthruStream(ResponseInterface $response, self $r, ?ChunkInterface $chunk, ?\SplObjectStorage $asyncMap): \Generator + private static function passthruStream(ResponseInterface $response, self $r, ?\SplObjectStorage $asyncMap, ?ChunkInterface $chunk = null): \Generator { while (true) { try { diff --git a/lam/lib/3rdParty/composer/symfony/http-client/Response/CurlResponse.php b/lam/lib/3rdParty/composer/symfony/http-client/Response/CurlResponse.php index 88cb76438..e5dfd3e52 100644 --- a/lam/lib/3rdParty/composer/symfony/http-client/Response/CurlResponse.php +++ b/lam/lib/3rdParty/composer/symfony/http-client/Response/CurlResponse.php @@ -265,11 +265,11 @@ final class CurlResponse implements ResponseInterface, StreamableInterface /** * @param CurlClientState $multi */ - private static function perform(ClientState $multi, ?array &$responses = null): void + private static function perform(ClientState $multi, ?array $responses = null): void { if ($multi->performing) { if ($responses) { - $response = current($responses); + $response = $responses[array_key_first($responses)]; $multi->handlesActivity[(int) $response->handle][] = null; $multi->handlesActivity[(int) $response->handle][] = new TransportException(sprintf('Userland callback cannot use the client nor the response while processing "%s".', curl_getinfo($response->handle, \CURLINFO_EFFECTIVE_URL))); } diff --git a/lam/lib/3rdParty/composer/symfony/http-client/Response/MockResponse.php b/lam/lib/3rdParty/composer/symfony/http-client/Response/MockResponse.php index 0493bcb7c..c6b96c0b1 100644 --- a/lam/lib/3rdParty/composer/symfony/http-client/Response/MockResponse.php +++ b/lam/lib/3rdParty/composer/symfony/http-client/Response/MockResponse.php @@ -167,7 +167,7 @@ class MockResponse implements ResponseInterface, StreamableInterface $runningResponses[0][1][$response->id] = $response; } - protected static function perform(ClientState $multi, array &$responses): void + protected static function perform(ClientState $multi, array $responses): void { foreach ($responses as $response) { $id = $response->id; diff --git a/lam/lib/3rdParty/composer/symfony/http-client/Response/NativeResponse.php b/lam/lib/3rdParty/composer/symfony/http-client/Response/NativeResponse.php index 9a5184ed6..54312884c 100644 --- a/lam/lib/3rdParty/composer/symfony/http-client/Response/NativeResponse.php +++ b/lam/lib/3rdParty/composer/symfony/http-client/Response/NativeResponse.php @@ -228,7 +228,7 @@ final class NativeResponse implements ResponseInterface, StreamableInterface /** * @param NativeClientState $multi */ - private static function perform(ClientState $multi, ?array &$responses = null): void + private static function perform(ClientState $multi, ?array $responses = null): void { foreach ($multi->openHandles as $i => [$pauseExpiry, $h, $buffer, $onProgress]) { if ($pauseExpiry) { diff --git a/lam/lib/3rdParty/composer/symfony/http-client/Response/TransportResponseTrait.php b/lam/lib/3rdParty/composer/symfony/http-client/Response/TransportResponseTrait.php index 7b65fd799..95f7e9624 100644 --- a/lam/lib/3rdParty/composer/symfony/http-client/Response/TransportResponseTrait.php +++ b/lam/lib/3rdParty/composer/symfony/http-client/Response/TransportResponseTrait.php @@ -92,7 +92,7 @@ trait TransportResponseTrait /** * Performs all pending non-blocking operations. */ - abstract protected static function perform(ClientState $multi, array &$responses): void; + abstract protected static function perform(ClientState $multi, array $responses): void; /** * Waits for network activity. @@ -150,10 +150,15 @@ trait TransportResponseTrait $lastActivity = hrtime(true) / 1E9; $elapsedTimeout = 0; - if ($fromLastTimeout = 0.0 === $timeout && '-0' === (string) $timeout) { - $timeout = null; - } elseif ($fromLastTimeout = 0 > $timeout) { - $timeout = -$timeout; + if ((0.0 === $timeout && '-0' === (string) $timeout) || 0 > $timeout) { + $timeout = $timeout ? -$timeout : null; + + /** @var ClientState $multi */ + foreach ($runningResponses as [$multi]) { + if (null !== $multi->lastTimeout) { + $elapsedTimeout = max($elapsedTimeout, $lastActivity - $multi->lastTimeout); + } + } } while (true) { @@ -162,8 +167,7 @@ trait TransportResponseTrait $timeoutMin = $timeout ?? \INF; /** @var ClientState $multi */ - foreach ($runningResponses as $i => [$multi]) { - $responses = &$runningResponses[$i][1]; + foreach ($runningResponses as $i => [$multi, &$responses]) { self::perform($multi, $responses); foreach ($responses as $j => $response) { @@ -171,26 +175,25 @@ trait TransportResponseTrait $timeoutMin = min($timeoutMin, $response->timeout, 1); $chunk = false; - if ($fromLastTimeout && null !== $multi->lastTimeout) { - $elapsedTimeout = hrtime(true) / 1E9 - $multi->lastTimeout; - } - if (isset($multi->handlesActivity[$j])) { $multi->lastTimeout = null; + $elapsedTimeout = 0; } elseif (!isset($multi->openHandles[$j])) { + $hasActivity = true; unset($responses[$j]); continue; } elseif ($elapsedTimeout >= $timeoutMax) { $multi->handlesActivity[$j] = [new ErrorChunk($response->offset, sprintf('Idle timeout reached for "%s".', $response->getInfo('url')))]; $multi->lastTimeout ??= $lastActivity; + $elapsedTimeout = $timeoutMax; } else { continue; } - while ($multi->handlesActivity[$j] ?? false) { - $hasActivity = true; - $elapsedTimeout = 0; + $lastActivity = null; + $hasActivity = true; + while ($multi->handlesActivity[$j] ?? false) { if (\is_string($chunk = array_shift($multi->handlesActivity[$j]))) { 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')))]; @@ -227,7 +230,6 @@ trait TransportResponseTrait } } elseif ($chunk instanceof ErrorChunk) { unset($responses[$j]); - $elapsedTimeout = $timeoutMax; } elseif ($chunk instanceof FirstChunk) { if ($response->logger) { $info = $response->getInfo(); @@ -274,10 +276,12 @@ trait TransportResponseTrait if ($chunk instanceof ErrorChunk && !$chunk->didThrow()) { // Ensure transport exceptions are always thrown $chunk->getContent(); + throw new \LogicException('A transport exception should have been thrown.'); } } if (!$responses) { + $hasActivity = true; unset($runningResponses[$i]); } @@ -291,7 +295,7 @@ trait TransportResponseTrait } if ($hasActivity) { - $lastActivity = hrtime(true) / 1E9; + $lastActivity ??= hrtime(true) / 1E9; continue; }