10000 [HttpClient] workaround curl_multi_select() issue by nicolas-grekas · Pull Request #33985 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpClient] workaround curl_multi_select() issue #33985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ install:
- php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
- git config --global user.email ""
- git config --global user.name "Symfony"
- php .github/build-packages.php "HEAD^" src\Symfony\Bridge\PhpUnit
- php .github/build-packages.php "HEAD^" src\Symfony\Bridge\PhpUnit src\Symfony\Contracts
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
- php composer.phar update --no-progress --no-suggest --ansi
Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Component/HttpClient/Response/CurlResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ private static function perform(CurlClientState $multi, array &$responses = null
*/
private static function select(CurlClientState $multi, float $timeout): int
{
if (\PHP_VERSION_ID < 70123 || (70200 <= \PHP_VERSION_ID && \PHP_VERSION_ID < 70211)) {
// workaround https://bugs.php.net/76480
$timeout = min($timeout, 0.01);
}

return curl_multi_select($multi->handle, $timeout);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,9 @@ public function testNotATimeout()
{
$client = $this->getHttpClient(__FUNCTION__);
$response = $client->request('GET', 'http://localhost:8057/timeout-header', [
'timeout' => 0.5,
'timeout' => 0.9,
]);
usleep(510000);
sleep(1);
$this->assertSame(200, $response->getStatusCode());
}

Expand Down
0