Skip to content

Commit 588e516

Browse files
Merge branch '5.1' into 5.x
* 5.1: [DI] fix dumping env vars [HttpClient] skip executing the multi handle when it's freed already [HttpClient] fix using freed curl resource at destruct time [HttpClient] shutdown verbose output from curl at destruction fix warning for preloading TranslatorTrait class [Typography] Remove unneeded description comments
2 parents 9ad799b + adaf123 commit 588e516

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CurlHttpClient.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,10 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
331331
throw new \TypeError(sprintf('"%s()" expects parameter 1 to be an iterable of CurlResponse objects, "%s" given.', __METHOD__, get_debug_type($responses)));
332332
}
333333

334-
$active = 0;
335-
while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
334+
if (\is_resource($this->multi->handle) || $this->multi->handle instanceof \CurlMultiHandle) {
335+
$active = 0;
336+
while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
337+
}
336338

337339
return new ResponseStream(CurlResponse::stream($responses, $timeout));
338340
}

Response/CurlResponse.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ public function getContent(bool $throw = true): string
247247

248248
public function __destruct()
249249
{
250+
curl_setopt($this->handle, \CURLOPT_VERBOSE, false);
251+
250252
if (null === $this->timeout) {
251253
return; // Unused pushed response
252254
}

0 commit comments

Comments
 (0)