From 69185319fc4ca19675e9dff5ad0015f68ccf51c6 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Wed, 19 Sep 2012 13:57:42 +0000 Subject: Added work-around for cURL 7.25.0 problem with first select call hanging --- it_url.class | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/it_url.class b/it_url.class index 1b82278..1e61578 100644 --- a/it_url.class +++ b/it_url.class @@ -398,9 +398,10 @@ function get_multi($p=null) $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); + $timeout = 0.001; # Very short timeout to work around problem with first select call on cURL 7.25.0 while ($active && $mrc == CURLM_OK) { - if (curl_multi_select($mh) != -1) + if (curl_multi_select($mh, $timeout) != -1) { do { $mrc = curl_multi_exec($mh, $active); @@ -416,6 +417,7 @@ function get_multi($p=null) } } while ($mrc == CURLM_CALL_MULTI_PERFORM); } + $timeout = 0.1; # Longer delay to avoid busy loop but shorter than default of 1s in case we stil hit cURL 7.25.0 problem } $results = array(); -- cgit v1.2.3