-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpClient] fix monitoring responses issued before reset() #44625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
44d0f0e
to
438c18c
Compare
@@ -325,7 +335,7 @@ private static function select(ClientState $multi, float $timeout): int | |||
$timeout = min($timeout, 0.01); | |||
} | |||
|
|||
return curl_multi_select($multi->handle, $timeout); | |||
return curl_multi_select($multi->handle[array_key_last($multi->handle)], $timeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the last key rather than the first one ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the last handle is one for which we're sure there is pending activity (since handles past the 0
one are all removed when they're empty).
16fe114
to
7506401
Compare
7506401
to
6e52960
Compare
This PR reverts symfony#44625 and uses a new curl-share handle instead to reset any state.
This PR reverts symfony#44625 and uses a new curl-share handle instead to reset any state.
This PR reverts symfony#44625 and uses a new curl-share handle instead to reset any state.
…ient::reset() (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] fix resetting DNS/etc when calling CurlHttpClient::reset() | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #44900 | License | MIT | Doc PR | - This PR reverts #44625 and uses a new curl-share handle instead to reset any state. Commits ------- d426646 [HttpClient] fix resetting DNS/etc when calling CurlHttpClient::reset()
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.