summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_url.class5
1 files changed, 4 insertions, 1 deletions
diff --git a/it_url.class b/it_url.class
index 8ee76b9..d196c54 100644
--- a/it_url.class
+++ b/it_url.class
@@ -103,8 +103,9 @@ function is_reachable($timeout = 5)
* @param $p['data'] POST data array with key-value pairs
* @param $p['files'] [fieldname => filename] of files to upload
* @param $p['writefunction'] function to be called whenever data is received (for server-sent-events etc.)
+ * @param $p['fetchsleep'] Number of seconds to wait after fetch, fractions ok
* @param $p['retries'] Number of retries if download fails, default 1
- * @param $p['retrysleep'] Number of seconds to wait before retry, fractions ok
+ * @param $p['retrysleep'] Number of seconds to wait before retry (additional to fetchsleep), fractions ok
* @param $p['compression'] use compression (uses curl to do that)
* @return contents of resulting page, considering redirects, excluding headers, or false on error
*/
@@ -139,6 +140,8 @@ function get($p=null, $timeout=5)
if (($filter = EDC('res')) && strstr($p['url'], it::replace(array('1' => ":"), $filter)))
ED($result);
+ usleep($p['fetchsleep'] * 1000000);
+
return $result;
}