From 2bbcde2b64230c0c361bf1220291cd2c78c866c7 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 12 May 2014 16:41:39 +1200 Subject: [PATCH] Avoid 100% CPU on curl_multi_exec Never finishes (up to max_execlution_limit) on PHP 5.4.24. See http://nz1.php.net/curl_multi_exec#113002 and http://www.adrianworlddesign.com/Knowledge-Base/php/Download-content-with-cURL/Doing-curlmultiexec-the-right-way --- code/checks/ExternalURLCheck.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/checks/ExternalURLCheck.php b/code/checks/ExternalURLCheck.php index a8a09b5..fb1530b 100644 --- a/code/checks/ExternalURLCheck.php +++ b/code/checks/ExternalURLCheck.php @@ -45,7 +45,8 @@ class ExternalURLCheck implements EnvironmentCheck { // Execute the handles do { $mrc = curl_multi_exec($mh, $active); - } while ($mrc == CURLM_CALL_MULTI_PERFORM); + curl_multi_select($mh); + } while ($active > 0); while ($active && $mrc == CURLM_OK) { if (curl_multi_select($mh) != -1) {