Skip to content

Commit fe9f3d6

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 ------- f35a6ad77e [HttpClient] Double check if handle is complete
2 parents 14d2fd5 + f401f03 commit fe9f3d6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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)