summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-09-23 03:42:32 +0000
committerColin Smith <colin@pfsense.org>2005-09-23 03:42:32 +0000
commit276fb955276e59de6c1a64d4daa4e0faff3a8e47 (patch)
treede617e4a3dee1b96bbf1b89eb4fe725b647af456 /etc
parent4335dc875148dc0f3c3af86d93ee5fa7e6b3e733 (diff)
downloadpfsense-276fb955276e59de6c1a64d4daa4e0faff3a8e47.zip
pfsense-276fb955276e59de6c1a64d4daa4e0faff3a8e47.tar.gz
download_file_with_progress_bar(): Return true if the transfer was successful or the last HTTP code received otherwise.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pkg-utils.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index 0729528..f752ec7 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -316,10 +316,10 @@ function download_file_with_progress_bar($url_file, $destination_file) {
curl_setopt($ch, CURLOPT_NOPROGRESS, '1');
curl_exec($ch);
+ $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
fclose($fout);
curl_close($ch);
-
- return 1;
+ return ($http_code == 200) ? true : $http_code;
}
function read_header($ch, $string) {
OpenPOWER on IntegriCloud