]> git.mxchange.org Git - friendica.git/blobdiff - include/network.php
Merge remote-tracking branch 'upstream/develop' into 1701-curl-range
[friendica.git] / include / network.php
index 969f583828851a59ceb55c97d072a6bae5ef325a..b7839de218e213d0462ecd72eef24f507125d4bf 100644 (file)
@@ -4,6 +4,8 @@
  * @file include/network.php
  */
 
+use \Friendica\Core\Config;
+
 require_once("include/xml.php");
 require_once('include/Probe.php');
 
@@ -93,7 +95,10 @@ function z_fetch_url($url,$binary = false, &$redirects = 0, $opts=array()) {
        @curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
        @curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
 
-
+       $range = intval(Config::get('system', 'curl_range_bytes', 0));
+       if ($range > 0) {
+               @curl_setopt($ch, CURLOPT_RANGE, '0-'.$range);
+       }
 
        if(x($opts,'headers')){
                @curl_setopt($ch, CURLOPT_HTTPHEADER, $opts['headers']);