summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Gass2017-12-18 16:38:23 +0100
committerNathan Gass2017-12-18 16:38:23 +0100
commit440f08f07dab0233716937e432d921436a342ee1 (patch)
tree6b8cbef0b06fee85d8b800947b19ae8b78ba3498
parent3d4d646cb366bd6de2bab48ce68f7c9edd2c61e9 (diff)
downloaditools-440f08f07dab0233716937e432d921436a342ee1.tar.gz
itools-440f08f07dab0233716937e432d921436a342ee1.tar.bz2
itools-440f08f07dab0233716937e432d921436a342ee1.zip
include curl_getinfo for errors, remove unused variable
-rw-r--r--it_url.class7
1 files changed, 4 insertions, 3 deletions
diff --git a/it_url.class b/it_url.class
index f5c2ab8..20dd171 100644
--- a/it_url.class
+++ b/it_url.class
@@ -252,7 +252,7 @@ function request($p=array())
if ($p['maxlength'] && (strlen($this->data) > $p['maxlength'])) {
$result = $this->result = false;
- $errstr = $this->errstr = "maxlength reached";
+ $this->errstr = "maxlength reached";
} else if ($p['filemtime'] && ($url->result == 304)) {
$result = true; # Not modified, success but no data
} else {
@@ -260,11 +260,12 @@ function request($p=array())
}
} else {
$result = $this->result = false;
- $errstr = $this->errstr = curl_error($curl);
+ $this->errstr = curl_error($curl);
+ $this->curlinfo = curl_getinfo($curl);
}
if ($got === false && $p['retries'] <= 0)
- it::error((array)$p['it_error'] + ['title' => "problem getting $url->url with curl: " . curl_error($curl)]);
+ it::error((array)$p['it_error'] + ['title' => "problem getting $url->url with curl: " . curl_error($curl), 'body' => curl_getinfo($curl)]);
return $result;
}