[HttpClient] Fix a crash when calling CurlHttpClient::__destruct()
This commit is contained in:
parent
4056baf0f4
commit
d2c5ffda52
@ -301,17 +301,22 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface
|
||||
public function __destruct()
|
||||
{
|
||||
$this->multi->pushedResponses = [];
|
||||
|
||||
if (\is_resource($this->multi->handle)) {
|
||||
if (\defined('CURLMOPT_PUSHFUNCTION')) {
|
||||
curl_multi_setopt($this->multi->handle, CURLMOPT_PUSHFUNCTION, null);
|
||||
}
|
||||
|
||||
$active = 0;
|
||||
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
|
||||
}
|
||||
|
||||
foreach ($this->multi->openHandles as [$ch]) {
|
||||
if (\is_resource($ch)) {
|
||||
curl_setopt($ch, CURLOPT_VERBOSE, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handlePush($parent, $pushed, array $requestHeaders, CurlClientState $multi, int $maxPendingPushes, ?LoggerInterface $logger): int
|
||||
{
|
||||
|
Reference in New Issue
Block a user