You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #44625 [HttpClient] fix monitoring responses issued before reset() (nicolas-grekas)
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] fix monitoring responses issued before reset()
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Follow up of #44601
In order to reset the DNS cache, we have to create a new curl-multi handle. But since there might still be responses attached to the previous handle, we need to keep it around to monitor it.
Best reviewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/44625/files?w=1).
Commits
-------
6e52960 [HttpClient] fix monitoring responses issued before reset()
Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/CurlHttpClient.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -306,9 +306,9 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
306
306
thrownew \TypeError(sprintf('"%s()" expects parameter 1 to be an iterable of CurlResponse objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
307
307
}
308
308
309
-
if (\is_resource($this->multi->handle) || $this->multi->handleinstanceof \CurlMultiHandle) {
309
+
if (\is_resource($mh = $this->multi->handles[0] ?? null) || $mhinstanceof \CurlMultiHandle) {
310
310
$active = 0;
311
-
while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active)) {
311
+
while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($mh, $active)) {
0 commit comments