summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_url.class')
-rw-r--r--it_url.class10
1 files changed, 5 insertions, 5 deletions
diff --git a/it_url.class b/it_url.class
index 8b2bd2b..6b1f81c 100644
--- a/it_url.class
+++ b/it_url.class
@@ -416,13 +416,13 @@ static function get_multi($p=null)
if (!$p['noresults'])
$results_unordered[$key] = $content;
- if (is_array($urls[$key]) && ($handler = $urls[$key]['handler']))
- $abort = $handler($info['handle'], $content);
-
- if (it::match(self::$retryable, curl_getinfo($handles[$key], CURLINFO_RESPONSE_CODE)) && $retries[$key]++ < $p['retries'])
+ if (it::match(self::$retryable, curl_getinfo($handles[$key], CURLINFO_RESPONSE_CODE)) && $retries[$key]++ < $p['retries']) {
$sleepuntils[$key] = microtime(true) + $p['retrysleep'];
- else
+ } else {
+ if (is_array($urls[$key]) && ($handler = $urls[$key]['handler']))
+ $abort = $handler($info['handle'], $content);
unset($urls[$key]);
+ }
$closehandle($key);
} else if($retries[$key]++ < $p['retries']) {
$closehandle($key); # closehandle must be called before addhandle as we use the same key