From cb97a97794ed448117a3268300053af886420f1e Mon Sep 17 00:00:00 2001 From: Aparup Banerjee Date: Tue, 14 May 2013 11:56:05 +0800 Subject: [PATCH] MDL-39664 allowed mdeploy to follow redirection (http 302) and added some extra logging info --- mdeploy.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mdeploy.php b/mdeploy.php index 579d89960ba..887a9a818c8 100644 --- a/mdeploy.php +++ b/mdeploy.php @@ -757,7 +757,7 @@ class worker extends singleton_pattern { $this->log('Package downloaded into '.$target); } else { $this->log('cURL error ' . $this->curlerrno . ' ' . $this->curlerror); - $this->log('Unable to download the file'); + $this->log('Unable to download the file from ' . $source . ' into ' . $target); throw new download_file_exception('Unable to download the package'); } @@ -1059,6 +1059,8 @@ class worker extends singleton_pattern { // use this CA cert to verify the ZIP provider. $this->log('Using custom CA certificate '.$cacertfile); curl_setopt($ch, CURLOPT_CAINFO, $cacertfile); + } else { + $this->log('Warning: '.$cacertfile.' not found'); } $proxy = $this->input->get_option('proxy', false); @@ -1105,9 +1107,12 @@ class worker extends singleton_pattern { $this->curlinfo = curl_getinfo($ch); if (!$result or $this->curlerrno) { + $this->log('Curl Error.'); return false; - } else if (is_array($this->curlinfo) and (empty($this->curlinfo['http_code']) or $this->curlinfo['http_code'] != 200)) { + } else if (is_array($this->curlinfo) && (empty($this->curlinfo['http_code']) or (($this->curlinfo['http_code'] != 200) && $this->curlinfo['http_code'] != 302))) { + $this->log('Curl remote error.'); + $this->log(print_r($this->curlinfo,true)); return false; }