From 0d89faa41fc0e9fa625de0c1451514fee26b83bb Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 18 Jun 2021 11:40:29 +0200 Subject: [PATCH] Use select() syscall to avoid busy waiting Currently it consumes a lot of CPU, it's a no-brainer i think. Co-authored-by: Diego de Estrada --- library/Requests/Transport/cURL.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/Requests/Transport/cURL.php b/library/Requests/Transport/cURL.php index 01bcf3b71..65f405761 100644 --- a/library/Requests/Transport/cURL.php +++ b/library/Requests/Transport/cURL.php @@ -220,6 +220,10 @@ public function request_multiple($requests, $options) { do { $active = 0; + if ($active) { + curl_multi_select($multihandle); + } + do { $status = curl_multi_exec($multihandle, $active); }