summaryrefslogtreecommitdiffstats
path: root/inc/util.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2014-03-20 17:44:58 +0100
committerSimon Rettberg2014-03-20 17:44:58 +0100
commitb6efc1db796a6be89f5f72a7c9485a31e1b99361 (patch)
tree93eb9baf2b1643ee5249288eddb33a0a8de9532d /inc/util.inc.php
parentEnable splash screen in PXE template (diff)
downloadslx-admin-b6efc1db796a6be89f5f72a7c9485a31e1b99361.tar.gz
slx-admin-b6efc1db796a6be89f5f72a7c9485a31e1b99361.tar.xz
slx-admin-b6efc1db796a6be89f5f72a7c9485a31e1b99361.zip
Fix handle leak in downloading, better error reporting on failed downloads, add nvidia_libs addon to downloads
Diffstat (limited to 'inc/util.inc.php')
-rw-r--r--inc/util.inc.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/inc/util.inc.php b/inc/util.inc.php
index 277dde31..67e4b73d 100644
--- a/inc/util.inc.php
+++ b/inc/util.inc.php
@@ -101,7 +101,9 @@ class Util
private static function getContents($fh)
{
fseek($fh, 0, SEEK_SET);
- return fread($fh, 10000);
+ $data = fread($fh, 10000);
+ fclose($fh);
+ return $data;
}
/**
@@ -144,7 +146,7 @@ class Util
if (preg_match('#^HTTP/\d+\.\d+ (\d+) #', $head, $out)) {
$code = (int)$out[1];
} else {
- $code = 999;
+ $code = '999 ' . curl_error($ch);
}
return true;
}