Skip to content

Commit 01a663a

Browse files
author
Anthony MARTIN
committed
[HttpClient] changes minimal php version to use curl push function
1 parent ac93c9e commit 01a663a

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)