Skip to content

Commit adaf123

Browse files
Merge branch '4.4' into 5.1
* 4.4: [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 9f651fe + 55ed03d commit adaf123

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
@@ -326,8 +326,10 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
326326
throw new \TypeError(sprintf('"%s()" expects parameter 1 to be an iterable of CurlResponse objects, "%s" given.', __METHOD__, get_debug_type($responses)));
327327
}
328328

329-
$active = 0;
330-
while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
329+
if (\is_resource($this->multi->handle) || $this->multi->handle instanceof \CurlMultiHandle) {
330+
$active = 0;
331+
while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
332+
}
331333

332334
return new ResponseStream(CurlResponse::stream($responses, $timeout));
333335
}

Response/CurlResponse.php

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

226226
public function __destruct()
227227
{
228+
curl_setopt($this->handle, \CURLOPT_VERBOSE, false);
229+
228230
if (null === $this->timeout) {
229231
return; // Unused pushed response
230232
}

0 commit comments

Comments
 (0)