From caf1ec20629df792d8fc6772ed0f83e1e50dc72a Mon Sep 17 00:00:00 2001 From: agapov97 Date: Mon, 26 Feb 2018 17:21:21 +0300 Subject: [PATCH] multicurl - starting new requests while curls array is not empty and activeCurls array size less than concurrency --- src/Curl/MultiCurl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Curl/MultiCurl.php b/src/Curl/MultiCurl.php index eb6c20f..e60bab1 100644 --- a/src/Curl/MultiCurl.php +++ b/src/Curl/MultiCurl.php @@ -696,7 +696,7 @@ class MultiCurl unset($this->activeCurls[$key]); // Start a new request before removing the handle of the completed one. - if (count($this->curls) >= 1) { + while (count($this->curls) >= 1 && count($this->activeCurls) < $this->concurrency) { $this->initHandle(array_shift($this->curls)); } curl_multi_remove_handle($this->multiCurl, $curl->curl);