From 440f08f07dab0233716937e432d921436a342ee1 Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Mon, 18 Dec 2017 16:38:23 +0100 Subject: include curl_getinfo for errors, remove unused variable --- it_url.class | 7 ++++--- 1 file 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; } -- cgit v1.2.3