summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_url.class')
-rw-r--r--it_url.class4
1 files changed, 4 insertions, 0 deletions
diff --git a/it_url.class b/it_url.class
index a54d1f6..fb5a1ff 100644
--- a/it_url.class
+++ b/it_url.class
@@ -156,6 +156,7 @@ function is_reachable($timeout = 5)
* @param $p['filemtime'] Add HTTP header to only fetch when newer than this, otherwise return true instead of data
* @param $p['data']: POST data array with key-value pairs
* @param $p['retries']: Number of retries if download fails, default 1
+ * @param $p['retrysleep'] Number of seconds to wait before retry, fractions ok
* @return contents of resulting page, considering redirects, excluding headers, or false on error
*/
function get($p=null, $timeout=5)
@@ -190,7 +191,10 @@ function get($p=null, $timeout=5)
}
if (!$result && $p['retries'] > 0 && $url->result < 400)
+ {
+ usleep($p['retrysleep']*1000000);
$result = $url->get(array('retries' => $p['retries'] - 1) + $p);
+ }
if (($filter = EDC('res')) && strstr($p['url'], it::replace(array('1' => ":"), $filter)))
ED($result);