Skip to content

Commit 2ff8c19

Browse files
bug #30594 [HttpClient] changes minimal php version to use curl push function (XuruDragon)
This PR was merged into the 4.3-dev branch. Discussion ---------- [HttpClient] changes minimal php version to use curl push function | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | Adding some changes to CurlHttpClient to avoid potential bugs in php < 7.2.17 or php < 7.3.4. For more information check these bugs : - https://bugs.php.net/bug.php?id=77747 - https://bugs.php.net/bug.php?id=77535 Resolve by the following commit by Nikic : - php/php-src@97f9fd6 Commits ------- 01a663a [HttpClient] changes minimal php version to use curl push function
2 parents ac93c9e + 01a663a commit 2ff8c19

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Symfony/Component/HttpClient/CurlHttpClient.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public function __construct(array $defaultOptions = [], int $maxHostConnections
6464
'dnsCache' => [[], [], []],
6565
];
6666

67-
// Skip configuring HTTP/2 push when it's unsupported or buggy, see https://bugs.php.net/76675
68-
if (\PHP_VERSION_ID < 70215 || \PHP_VERSION_ID === 70300 || \PHP_VERSION_ID === 70301) {
67+
// Skip configuring HTTP/2 push when it's unsupported or buggy, see https://bugs.php.net/bug.php?id=77535
68+
if (\PHP_VERSION_ID < 70217 || (\PHP_VERSION_ID >= 70300 && \PHP_VERSION_ID < 70304)) {
6969
return;
7070
}
7171

@@ -74,8 +74,7 @@ public function __construct(array $defaultOptions = [], int $maxHostConnections
7474
return;
7575
}
7676

77-
// Keep a dummy "onPush" reference to work around a refcount bug in PHP
78-
curl_multi_setopt($mh, CURLMOPT_PUSHFUNCTION, $multi->onPush = static function ($parent, $pushed, array $rawHeaders) use ($multi) {
77+
curl_multi_setopt($mh, CURLMOPT_PUSHFUNCTION, static function ($parent, $pushed, array $rawHeaders) use ($multi) {
7978
return self::handlePush($parent, $pushed, $rawHeaders, $multi);
8079
});
8180
}

0 commit comments

Comments
 (0)