Merge pull request #3485 from annando/range-curl

Bugfix ParseUrl: Only fetch a range to avoid memory issues
This commit is contained in:
Tobias Diekershoff 2017-05-23 08:16:34 +02:00 committed by GitHub
commit 86e2dc2009

View file

@ -155,6 +155,12 @@ class ParseUrl {
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); @curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
} }
$range = intval(Config::get('system', 'curl_range_bytes', 0));
if ($range > 0) {
curl_setopt($ch, CURLOPT_RANGE, '0-' . $range);
}
$header = curl_exec($ch); $header = curl_exec($ch);
$curl_info = @curl_getinfo($ch); $curl_info = @curl_getinfo($ch);
curl_close($ch); curl_close($ch);