From 1e4439010c6cf239d5005b0341ca12c71733f1b0 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 30 Jul 2020 17:06:52 +0200 Subject: remove option with single use for now, fix inserting too many woke up handles at once --- it_url.class | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'it_url.class') diff --git a/it_url.class b/it_url.class index 792a839..712074d 100644 --- a/it_url.class +++ b/it_url.class @@ -337,7 +337,6 @@ function request($p=array()) * @param $p['headers'] optional array of HTTP headers to send * @param $p['parallel'] max number of parallel requests * @param $p['noresults'] do not keep results around - * @param $p['fetchsleep'] number of seconds to wait after fetch, fractions ok * @return array of contents (or false for errors like timesou) of resulting page using same * keys as the urls input array, considering redirects, excluding headers */ @@ -405,7 +404,6 @@ static function get_multi($p=null) { if ($info['msg'] == CURLMSG_DONE) { - usleep($p['fetchsleep'] * 1000000); $key = $keys[$info['handle']]; $content = curl_multi_getcontent($info['handle']); if (isset($p['postprocess'])) @@ -439,7 +437,7 @@ static function get_multi($p=null) } while ($mrc == CURLM_CALL_MULTI_PERFORM); foreach ((array)$sleepuntils as $key => $time) { - if (microtime(true) >= $time) { + if (microtime(true) >= $time && count($handles) < $parallel) { $addhandle($key, $urls[$key]); unset($sleepuntils[$key]); } -- cgit v1.2.3