Skip to content

Commit

Permalink
Only close curl handle if it's done (#2950)
Browse files Browse the repository at this point in the history
  • Loading branch information
divinity76 committed Dec 6, 2021
1 parent 1d347d7 commit e6765c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Handler/CurlMultiHandler.php
Expand Up @@ -225,6 +225,10 @@ private function cancel($id): bool
private function processMessages(): void
{
while ($done = \curl_multi_info_read($this->_mh)) {
if ($done['msg'] !== \CURLMSG_DONE) {
// if it's not done, then it would be premature to remove the handle. ref https://github.com/guzzle/guzzle/pull/2892#issuecomment-945150216
continue;
}
$id = (int) $done['handle'];
\curl_multi_remove_handle($this->_mh, $done['handle']);

Expand Down

0 comments on commit e6765c0

Please sign in to comment.