summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_url.class21
1 files changed, 11 insertions, 10 deletions
diff --git a/it_url.class b/it_url.class
index 3888b17..e961b4c 100644
--- a/it_url.class
+++ b/it_url.class
@@ -220,15 +220,16 @@ function is_reachable($timeout = 5)
* If the protocol is not http, only features of get_multi are supported.
*
* @param $p parameter array with the following keys
- * @param $p['url']: url to get, defaults to constructor URL
- * @param $p['headers']: optional array of HTTP headers to send
- * @param $p['timeout']: timeout per read in seconds, defaults to 5. fractions allowed. silent, see $p['safety']
- * @param $p['safety']: set to 1 to generate an it::error in case of timeout
- * @param $p['totaltimeout']: timeout for the whole function call
- * @param $p['maxlength']: maximum length of response
- * @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['url'] url to get, defaults to constructor URL
+ * @param $p['headers'] optional array of HTTP headers to send
+ * @param $p['safety'] set to 1 to generate an it::error in case of timeout
+ * @param $p['it_error'] extra arguments given to it_error if safety is on an an error occurs
+ * @param $p['timeout'] timeout per read in seconds, defaults to 5. fractions allowed. silent, see $p['safety']
+ * @param $p['totaltimeout'] timeout for the whole function call
+ * @param $p['maxlength'] maximum length of response
+ * @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
* @return contents of resulting page, considering redirects, excluding headers, or false on error
*/
function get($p=null, $timeout=5)
@@ -375,7 +376,7 @@ function request($p=array())
$result = false;
if ($result === false && $p['safety'] == 1)
- it::error("problem (timeout?) getting $url->url " . $errstr);
+ it::error(array('title' => "problem (timeout?) getting $url->url " . $errstr) + (array)$p['it_error']);
if ($p['maxlength'] && (strlen($this->data) + $len > $p['maxlength']))
$result = false;