diff --git a/conf/config.php b/conf/config.php index 52b9c9357..870b59bc3 100644 --- a/conf/config.php +++ b/conf/config.php @@ -47,6 +47,9 @@ // $scgi_host = "unix:///tmp/rpc.socket"; $XMLRPCMountPoint = "/RPC2"; // DO NOT DELETE THIS LINE!!! DO NOT COMMENT THIS LINE!!! + + $throttleMaxSpeed = 327625*1024; // DO NOT EDIT THIS LINE!!! DO NOT COMMENT THIS LINE!!! + // Can't be greater then 327625*1024 due to limitation in libtorrent ResourceManager::set_max_upload_unchoked function. $pathToExternals = array( "php" => '', // Something like /usr/bin/php. If empty, will be found in PATH. diff --git a/plugins/throttle/throttle.php b/plugins/throttle/throttle.php index 9ea93365e..d374ee9e8 100644 --- a/plugins/throttle/throttle.php +++ b/plugins/throttle/throttle.php @@ -3,9 +3,6 @@ require_once( $rootPath.'/php/cache.php'); eval(FileUtil::getPluginConf('throttle')); -@define('MAX_SPEED', 327625*1024); -// Can't be greater then 327625*1024 due to limitation in libtorrent ResourceManager::set_max_upload_unchoked function. - class rThrottle { public $hash = "throttle.dat"; @@ -127,11 +124,12 @@ public function obtain() new rXMLRPCCommand( "get_download_rate" ) )); if($req->run() && !$req->fault) { + global $throttleMaxSpeed; $req1 = new rXMLRPCRequest(); if($req->val[0]==0) - $req1->addCommand(new rXMLRPCCommand( "set_upload_rate", MAX_SPEED )); + $req1->addCommand(new rXMLRPCCommand( "set_upload_rate", $throttleMaxSpeed )); if($req->val[1]==0) - $req1->addCommand(new rXMLRPCCommand( "set_download_rate", MAX_SPEED )); + $req1->addCommand(new rXMLRPCCommand( "set_download_rate", $throttleMaxSpeed )); if((($req->val[0]==0) || ($req->val[1]==0)) && (!$req1->run() || $req1->fault)) return(false);