Skip to content

Commit 513fc4c

Browse files
bug #44479 [HttpClient] Double check if handle is complete (Nyholm)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [HttpClient] Double check if handle is complete | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | This is a forward compatibility fix. We did the same in Guzzle after a comment from bagder. guzzle/guzzle#2892 (comment) Basically, if libcurl decides to add an other value for `msg`, then our code will break without this PR. The only value for `msg` with current latest version of curl is `CURLMSG_DONE` which means that this is not a bugfix yet.. but it make sure that we respect the libcurl API. Commits ------- f35a6ad [HttpClient] Double check if handle is complete
2 parents 9603e56 + f35a6ad commit 513fc4c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/HttpClient/Response/CurlResponse.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ private static function perform(ClientState $multi, array &$responses = null): v
277277
while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($multi->handle, $active));
278278

279279
while ($info = curl_multi_info_read($multi->handle)) {
280+
if (\CURLMSG_DONE !== $info['msg']) {
281+
continue;
282+
}
280283
$result = $info['result'];
281284
$id = (int) $ch = $info['handle'];
282285
$waitFor = @curl_getinfo($ch, \CURLINFO_PRIVATE) ?: '_0';

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy