diff options
author | Colin Smith <colin@pfsense.org> | 2005-09-23 03:42:32 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-09-23 03:42:32 +0000 |
commit | 276fb955276e59de6c1a64d4daa4e0faff3a8e47 (patch) | |
tree | de617e4a3dee1b96bbf1b89eb4fe725b647af456 /etc/inc/pkg-utils.inc | |
parent | 4335dc875148dc0f3c3af86d93ee5fa7e6b3e733 (diff) | |
download | pfsense-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/inc/pkg-utils.inc')
-rw-r--r-- | etc/inc/pkg-utils.inc | 4 |
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) { |