File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747 // $scgi_host = "unix:///tmp/rpc.socket";
4848
4949 $ XMLRPCMountPoint = "/RPC2 " ; // DO NOT DELETE THIS LINE!!! DO NOT COMMENT THIS LINE!!!
50+
51+ $ throttleMaxSpeed = 327625 *1024 ; // DO NOT EDIT THIS LINE!!! DO NOT COMMENT THIS LINE!!!
52+ // Can't be greater then 327625*1024 due to limitation in libtorrent ResourceManager::set_max_upload_unchoked function.
5053
5154 $ pathToExternals = array (
5255 "php " => '' , // Something like /usr/bin/php. If empty, will be found in PATH.
Original file line number Diff line number Diff line change 33require_once ( $ rootPath .'/php/cache.php ' );
44eval (FileUtil::getPluginConf ('throttle ' ));
55
6- @define ('MAX_SPEED ' , 327625 *1024 );
7- // Can't be greater then 327625*1024 due to limitation in libtorrent ResourceManager::set_max_upload_unchoked function.
8-
96class rThrottle
107{
118 public $ hash = "throttle.dat " ;
@@ -127,11 +124,12 @@ public function obtain()
127124 new rXMLRPCCommand ( "get_download_rate " ) ));
128125 if ($ req ->run () && !$ req ->fault )
129126 {
127+ global $ throttleMaxSpeed ;
130128 $ req1 = new rXMLRPCRequest ();
131129 if ($ req ->val [0 ]==0 )
132- $ req1 ->addCommand (new rXMLRPCCommand ( "set_upload_rate " , MAX_SPEED ));
130+ $ req1 ->addCommand (new rXMLRPCCommand ( "set_upload_rate " , $ throttleMaxSpeed ));
133131 if ($ req ->val [1 ]==0 )
134- $ req1 ->addCommand (new rXMLRPCCommand ( "set_download_rate " , MAX_SPEED ));
132+ $ req1 ->addCommand (new rXMLRPCCommand ( "set_download_rate " , $ throttleMaxSpeed ));
135133 if ((($ req ->val [0 ]==0 ) || ($ req ->val [1 ]==0 )) &&
136134 (!$ req1 ->run () || $ req1 ->fault ))
137135 return (false );
You can’t perform that action at this time.
0 commit comments