Skip to content

Commit e89856a

Browse files
author
Kyra Farrow
committed
Merge branch '4.3' into 4.4
* 4.3: SCA: minor code tweaks [HttpClient] fallbackto CURLMOPT_MAXCONNECTS when CURLMOPT_MAX_HOST_CONNECTIONS is not available fixed typo [HttpKernel] Fix Apache mod_expires Session Cache-Control issue Fix getFileLinkFormat() to avoid returning the wrong URL in Profiler
2 parents 8ed13ff + 5435135 commit e89856a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CurlHttpClient.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ public function __construct(array $defaultOptions = [], int $maxHostConnections
7373
curl_multi_setopt($this->multi->handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
7474
}
7575
if (\defined('CURLMOPT_MAX_HOST_CONNECTIONS')) {
76-
curl_multi_setopt($this->multi->handle, CURLMOPT_MAX_HOST_CONNECTIONS, 0 < $maxHostConnections ? $maxHostConnections : PHP_INT_MAX);
76+
$maxHostConnections = curl_multi_setopt($this->multi->handle, CURLMOPT_MAX_HOST_CONNECTIONS, 0 < $maxHostConnections ? $maxHostConnections : PHP_INT_MAX) ? 0 : $maxHostConnections;
77+
}
78+
if (\defined('CURLMOPT_MAXCONNECTS') && 0 < $maxHostConnections) {
79+
curl_multi_setopt($this->multi->handle, CURLMOPT_MAXCONNECTS, $maxHostConnections);
7780
}
7881

7982
// Skip configuring HTTP/2 push when it's unsupported or buggy, see https://bugs.php.net/77535

0 commit comments

Comments
 (0)