summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_url.class6
1 files changed, 3 insertions, 3 deletions
diff --git a/it_url.class b/it_url.class
index 6b2593c..c7c3ed5 100644
--- a/it_url.class
+++ b/it_url.class
@@ -212,7 +212,7 @@ static function curl_opts($p=array())
return $add + [
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
- CURLOPT_TIMEOUT => $p['totaltimeout'],
+ CURLOPT_TIMEOUT_MS => $p['totaltimeout'] * 1000, # use _MS to support fractions of seconds
CURLOPT_LOW_SPEED_LIMIT => 5,
CURLOPT_LOW_SPEED_TIME => $p['timeout'],
CURLOPT_FOLLOWLOCATION => $p['followlocation'],
@@ -298,7 +298,7 @@ function request($p=array())
* @param $p parameter array with the following keys (same as it_url::get)
* @param $p['urls']: array of urls to get
* @param $p['timeout']: timeout per read in seconds, defaults to 5. (TODO: fractions allowed?)
- * @param $p['totaltimeout']: timeout for the whole function call
+ * @param $p['totaltimeout']: timeout for the whole function call (fractions allowed)
* @param $p['headers']: optional array of HTTP headers to send
* @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
@@ -625,7 +625,7 @@ static function _waitforlockedfile($path, $p)
}
if ($lockedbyother)
- it::error((array)$p['it_error'] + ['title' => ($passes < $maxpasses ? "error getting url" : "timeout") . " in it_url::get_cache(): url={$p['url']}, passes=$passes, maxpasses=$maxpasses, path={$p['path']}"]);
+ it::error((array)$p['it_error'] + ['title' => ($passes < $maxpasses ? "error getting url" : "timeout") . " in it_url::get_cache(): url={$p['url']}, passes=$passes, maxpasses=$maxpasses, path=$path"]);
return !$lockedbyother && file_exists($path);
}