Commit fbc3369a authored by Gabor Hudiczius's avatar Gabor Hudiczius
Browse files

rtwi-0.2.1-070920

parent 95d57e0d
......@@ -3,14 +3,16 @@ requirements:
-xmlrpc >= 1.07
-some webserver
-php5, with the following extensions:
-xsl
-xsl (libxslt1.1)
-xmlrpc
installation:
make, libcurl-openssl-dev, pkg-config, sigc++-2.0-dev, libncurses-dev
to install xmlrpc, get the source from here: http://sourceforge.net/project/showfiles.php?group_id=16847
in my case, i could only compile the 1.11.00 version (due to a known bug, you may try to configure with --disable-cplusplus)
of course, you can try any version, over 1.07
in my case, i could only compile the 1.11.00 version (due to a known bug, you may try to configure with --disable-cplusplus, if the compiling stops with some syntax error)
of course, you can try any version, over 1.07 (or any version over 1.00, but you'll get incorrect data for values bigger than 2^31-1, since it does not support 64bit integers)
follow the next steps, as root (this step is not needed, if you're upgrading from a pervious version):
cd /usr/src
wget http://dfn.dl.sourceforge.net/sourceforge/xmlrpc-c/xmlrpc-c-1.11.00.tgz
......@@ -20,7 +22,7 @@ follow the next steps, as root (this step is not needed, if you're upgrading fro
make
make install
to install libtorrent, follow the next steps, as a root:
to install libtorrent, follow the next steps, as root:
mkdir /usr/src/libtorrent
wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.11.8.tar.gz
tar xvf libtorrent-0.11.8.tar.gz
......@@ -29,7 +31,7 @@ to install libtorrent, follow the next steps, as a root:
make
make install
to install rtorrent, follow the next steps, as a root:
to install rtorrent, follow the next steps, as root:
mkdir /usr/src/rtorrent
wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.7.8.tar.gz
tar xvf rtorrent-0.7.8.tar.gz
......@@ -38,27 +40,31 @@ to install rtorrent, follow the next steps, as a root:
make
make install
now, after everything's done
-extract the rtwi-xxxxxx.tar.gz to some place where your webserver can see it
-open the includes/config.php.inc, and edit the next lines (this step is not needed, if you're upgrading from a pervious version):
-$abs_path (the absolute path of your webroot, i.e.: "/var/www")
-$domain (your domain, i.e.: "example.com")
-$site_path (the relative path of the rtwi-xxxx directory, or whatever you renamed it, within your webroot, i.e.: "/rtwi/", if it's absolute path is /var/www/rtwi/)
-$include_path (if you move the includes directory, or eave it untouched, i.e.: "/includes")
-if your php interpreter does not handle .html files (only .php) set the $default_ext variable to "php", and rename the index.html to index.php
-if you don't have a .rtorrent.rc file, create one into your home directory
-you can find an example .rtorrent.rc file here: http://libtorrent.rakshasa.no/browser/trunk/rtorrent/doc/rtorrent.rc?rev=latest
-open .rtorrent.rc, and edit them (for each user)
-add this line to your .rtorrent.rc "scgi_port = 127.0.0.1:12345" where 12345 can be replaced by your choice, and restart rtorrent
-if you have more than one user, set a different port for each user's .rtorrent.rc file (be aware, to set different session directories for the users)
-set your download directory
-make sure, you have your session directory set and it exists, so rtorrent can continue will remember your torrents after it's restarted
now, you can start rtorrent, and on the bottom, you should see something like this: "(20:55:52) XMLRPC initialized with 346 functions."
-adding users (this step is not needed, if you're upgrading from a pervious version):
if everything went fine, extract the rtwi-xxxxxx.tar.gz to some place where your webserver can see it
in case, it's your first install, open the freshly extracted includes/config.php.inc, and edit the next lines:
-$abs_path (the absolute path of your webroot, i.e.: "/var/www")
-$domain (your domain, i.e.: "example.com")
-$site_path (the relative path of the rtwi-xxxx directory, or whatever you renamed it, within your webroot, i.e.: "/rtwi/", if it's absolute path is /var/www/rtwi/)
-$include_path (if you move the includes directory, or eave it untouched, i.e.: "/includes")
-if your php interpreter does not handle .html files (only .php) set the $default_ext variable to "php", and rename the index.html to index.php
adding users:
-find row 44, and change it:
-replace "userX" with the actual linux username (keep the quotes)
-replace "1234567890abcdef1234567890abcdef12345678" with the hash of the choosen password for the webui (you can generate the sha1 hash here => http://www.johnmaguire.us/tools/hashcalc/index.php)
-replace "userX" with the actual linux username
-replace "1234567890abcdef1234567890abcdef12345678" with the sha1 hash of the choosen password for the webui (you can generate the sha1 hash here => http://www.johnmaguire.us/tools/hashcalc/index.php)
-replace "12345", with the port, you've set in the user's .rtorrent.rc file
-keep the quotes in the last three steps
-if you have more than one user, you have to do these steps, for each one of them, sop you'll get something like this:
-if you have more than one user, you have to repeat these steps, for each one of them, so you'll get something like this:
$users = array(
"user1" => array( "pass" => "1234567890abcdef1234567890abcdef12345678", "port" => "12345" ),
"user2" => array( "pass" => "1234567890abcdef1234567890abcdef12345678", "port" => "12346" ),
......@@ -66,7 +72,48 @@ now, after everything's done
);
-all users, using this webui will need an "!rtwi_files" directory into their download directory (set by "directory = some/path" in the .rtorrent.rc) with 0777 rights
-the download directory should be inside your home directory (this might change later, as soon as i find out something secure)
troubleshooting:
-xmlrpc 1.11 compilation stops with some syntax error
-try to configure with --disable-cplusplus
-rtorrent compilation stops with an errer, which says, i have no libtorrent installed (No package 'libtorrent' found)
-find your libtorrent.pc file (try /usr/local/lib/pkgconfig), and set the PKG_CONFIG_PATH environmental variable to it's path (export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig)
-rtorrent compilation stops with an error, which says, my libtorrent's version is an empty string (Requested 'libtorrent >= 0.11.8' but version of libtorrent is)
-upgrade you automake (you need 1.5+)
-i can see the php code in the browser
-you php settings does not allows you to to have a php file named .html - change these settings, or rename the index.html to index.php, and set the $default_ext variable to "php" in rtwi's /includes/config.inc.php
-php modul is not loaded by the webserver, take a look at your webserver's manual, to find out, how to enable it
-i get some php errors about xsl...
-install (or if it's installed, than enable) the xsl php extension
-i get some php errors about xmlrpc...
-install (or if it's installed, than enable) the xmlrpc php extension
-i've set my username and my password in the config.inc.php, ut i cannot log in
-did you use the password?> you need to use the password's sha1 hash (you can generate one here =>you can generate the sha1 hash here => http://www.johnmaguire.us/tools/hashcalc/index.php)
-enable cookies (or at least session cookies)
-i get the "No connection" message in rtwi
-set the same port in your .rtorrent.rc file, at the scgi_port=, and in the rtwi's /includes/config.inc.php at your user's line
-check, if rtottent is listening on the port, you've set (netstat -na | grep 12345)
-if it is
-check your firewall
-recheck the port set in rtwi's incudes/config.inc.php
-if it is not
-recheck your .rtorrent.rc - it should have a line like this: scgi_port = 127.0.0.1:12345
-try to set the scgi port in runtime (ctrl+x, then entre "scgi_port = 127.0.0.1:12345")
-if rtorrent stops with an error, that says xmlrpc is not supported, configure xmlrpc-c with --with-xmlrpc-c, and recompile
-the add torrent menu does not work (at all - it shows me an empty page)
-your download directory should be in your home directory
bug reports, whishlist, suggestions, anything: ghudiczius@gmail.com
p.s.: sorry, for this loosy manual, and my even worse english :)
p.s.: sorry, for the lot's of typo, this loosy manual, and my even worse english :)
......@@ -26,7 +26,7 @@ $url["full"] = "{$url["base"]}/index.{$default_ext}"; // absolute url, of the
*******************************/
$xmlrpc_array = array(
"host" => "127.0.0.1", // ip address of the rtorrent
"host" => "127.0.0.1", // ip address of rtorrent
"port" => 0, // scgi port - we will set this depending on the user's settings
"timeout" => 10, // connection timeout
);
......@@ -50,6 +50,12 @@ $users = array(
* other settings
*******************************/
// umask for new files - set this to "0000" (keep the quotes) if you want to remove the files when erasing a torrent - also need to change download directory permissions (see the manual)
$torrents_umask = "0000";
// do a directory tree - set to "false" (witouth the quotes), if your webserver is running on a slow machine, and you have torrents with a lots of files (a few hundreds)
$dodirtree = false;
// language (only english is available atm)
$lang = "en";
......
......@@ -9,10 +9,19 @@ $message = array(
"nohashfound" => "No torrents found for this hash",
"noidfound" => "No id was given",
"noinputmod" => "No mod was specified",
"nooponalltorrent" => "No task was given",
"notanurl" => "Not valid URL was given",
"notrtfdircreated" => "You MUST have an \"!rtwi_files\" (without quotes) directory with 0777 rights in your rTorrent download directory",
"notrtfdirwriteright" => "The \"!rtwi_files\" directory in your rTorrent download directory MUST have 0777 rights",
"rtfileinisize" => "The uploaded file exceeds the upload_max_filesize directive in php.ini",
"rtfileformsize" => "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form",
"rtfilepartial" => "The uploaded file was only partially uploaded",
"rtfilenofile" => "No file was uploaded",
"rtfilenotmpdir" => "Missing a temporary folder",
"rtfilenowrite" => "Failed to write file to disk",
"rtfileother" => "Upload error",
"badrtdirectory" => "rTorrent download directry is not set correctly",
"badatpath" => "Invalid path was given",
......@@ -28,11 +37,20 @@ $message = array(
"succtorrentload" => "Torrent loaded",
"succtorrentstart" => "Torrent started",
"succtorrentsstart" => "Torrents started",
"succtorrentopen" => "Torrent opened",
"succtorrentsopen" => "Torrents opened",
"succtorrentstop" => "Torrent stopped",
"succtorrentsstop" => "Torrents stopped",
"succtorrentclose" => "Torrent closed",
"succtorrentsclose" => "Torrents closed",
"succtorrentcheckhash" => "Torrent hash check started",
"succtorrentscheckhash" => "Torrents hash check started",
"succtorrentremove" => "Torrent removed",
"succtorrentsremove" => "Torrents removed",
"succtorrenterase" => "Torrent erased",
"warntorrenterase" => "Torrent erased, but not all the files removed",
"succtorrentserase" => "Torrents erased",
"succprioritychange" => "Torrent priority changed",
"succfileprioritychange" => "File priority changed",
"succtrackerenabledchange" => "Tracker availablity changed",
......
......@@ -21,19 +21,38 @@ function make_abs_path( &$rel_path, &$cwd, $home ) {
return $ret;
}
function switch_bytes( $bytes ) {
if ( $bytes >= 1024 * 1024 * 1024 ) {
$ret = $bytes / 1024 / 1024 / 1024;
$suffix = "GB";
} elseif ( $bytes >= 1024 * 1024 ) {
$ret = $bytes / 1024 / 1024;
$suffix = "MB";
} elseif ( $bytes >= 1024 ) {
$ret = $bytes / 1024;
$suffix = "KB";
} else {
$ret = $bytes;
$suffix = "B";
function switch_bytes( $bytes, $d_suffix = "" ) {
switch ( $d_suffix ) {
case "GB" : {
$ret = $bytes / 1024 / 1024 / 1024;
$suffix = "GB";
break;
}
case "MB" : {
$ret = $bytes / 1024 / 1024;
$suffix = "MB";
break;
}
case "KB" : {
$ret = $bytes / 1024;
$suffix = "KB";
break;
}
default : {
if ( $bytes >= 1024 * 1024 * 1024 ) {
$ret = $bytes / 1024 / 1024 / 1024;
$suffix = "GB";
} elseif ( $bytes >= 1024 * 1024 ) {
$ret = $bytes / 1024 / 1024;
$suffix = "MB";
} elseif ( $bytes >= 1024 ) {
$ret = $bytes / 1024;
$suffix = "KB";
} else {
$ret = $bytes;
$suffix = "B";
}
}
}
return array( $ret, $suffix );
......@@ -42,25 +61,28 @@ function switch_bytes( $bytes ) {
function prepare_si_responses( &$responses, &$message, &$home_path ) {
$bytes_down_arr = switch_bytes( $responses["bytes_down"] );
$bytes_up_arr = switch_bytes( $responses["bytes_up"] );
$download_rate_arr = switch_bytes( $responses["download_rate"] );
$download_rate_arr = switch_bytes( $responses["download_rate"], "KB" );
$hash_read_ahead_arr = switch_bytes( $responses["hash_read_ahead"] );
$max_memory_usage_arr = switch_bytes( $responses["max_memory_usage"] );
$memory_usage_arr = switch_bytes( $responses["memory_usage"] );
$preload_min_size_arr = switch_bytes( $responses["preload_min_size"] );
$preload_required_rate_arr = switch_bytes( $responses["preload_required_rate"] );
$receive_buffer_size_arr = switch_bytes( $responses["receive_buffer_size"] );
$send_buffer_size_arr = switch_bytes( $responses["send_buffer_size"] );
$upload_rate_arr = switch_bytes( $responses["upload_rate"] );
$upload_rate_arr = switch_bytes( $responses["upload_rate"], "KB" );
$responses["bytes_down_value"] = sprintf( "%.1f", $bytes_down_arr[0] );
$responses["bytes_down_suffix"] = $bytes_down_arr[1];
$responses["bytes_up_value"] = sprintf( "%.1f", $bytes_up_arr[0] );
$responses["bytes_up_suffix"] = $bytes_up_arr[1];
$responses["download_rate_value"] = sprintf( "%.1f", $download_rate_arr[0] );
$responses["download_rate_value"] = sprintf( "%.0f", $download_rate_arr[0] );
$responses["download_rate_suffix"] = $download_rate_arr[1];
$responses["hash_read_ahead_value"] = sprintf( "%.1f", $hash_read_ahead_arr[0] );
$responses["hash_read_ahead_suffix"] = $hash_read_ahead_arr[1];
$responses["max_memory_usage_value"] = sprintf( "%.1f", $max_memory_usage_arr[0] );
$responses["max_memory_usage_suffix"] = $max_memory_usage_arr[1];
$responses["memory_usage_value"] = sprintf( "%.1f", $memory_usage_arr[0] );
$responses["memory_usage_suffix"] = $memory_usage_arr[1];
$responses["preload_min_size_value"] = sprintf( "%.1f", $preload_min_size_arr[0] );
$responses["preload_min_size_suffix"] = $preload_min_size_arr[1];
$responses["preload_required_rate_value"] = sprintf( "%.1f", $preload_required_rate_arr[0] );
......@@ -69,7 +91,7 @@ function prepare_si_responses( &$responses, &$message, &$home_path ) {
$responses["receive_buffer_size_suffix"] = $receive_buffer_size_arr[1];
$responses["send_buffer_size_value"] = sprintf( "%.1f", $send_buffer_size_arr[0] );
$responses["send_buffer_size_suffix"] = $send_buffer_size_arr[1];
$responses["upload_rate_value"] = sprintf( "%.1f", $upload_rate_arr[0] );
$responses["upload_rate_value"] = sprintf( "%.0f", $upload_rate_arr[0] );
$responses["upload_rate_suffix"] = $upload_rate_arr[1];
$responses["check_hash_value"] = $responses["check_hash"] == 0 ? $message["no"] : $message["yes"];
......@@ -380,7 +402,9 @@ function build_xmltree( $list, &$tree, &$xml ) {
return $ret;
}
function xmlrpc_call( &$xmlrpc_array, &$request ) {
function xmlrpc_call( &$xmlrpc_array, &$request, &$callnum, &$calltime ) {
$st = getmicrotime();
$len = strlen( $request );
$headers = "CONTENT_LENGTH\0{$len}\0";
$headers .= "SCGI\01\0";
......@@ -400,17 +424,21 @@ function xmlrpc_call( &$xmlrpc_array, &$request ) {
$ret = $errno;
}
$tt = getmicrotime();
$callnum++;
$calltime += $tt - $st;
return $ret;
}
function xmlrpc_multicall( &$xmlrpc_array, &$methodlist, $params = array() ) {
function xmlrpc_multicall( &$xmlrpc_array, &$methodlist, &$multicallnum, &$callnum, &$calltime, $params = array() ) {
$request = array();
foreach ( $methodlist as $methodkey => $methodval ) {
$request[] = array( "methodName" => $methodval, "params" => $params );
}
$request = xmlrpc_encode_request( "system.multicall", array( $request ) );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$response = xmlrpc_decode( $response );
$r = 0;
$responses = array();
......@@ -429,6 +457,8 @@ function xmlrpc_multicall( &$xmlrpc_array, &$methodlist, $params = array() ) {
$responses[$methodval] = $response[$r++][0];
}
$multicallnum++;
return $responses;
}
......@@ -456,6 +486,8 @@ function xmlrpc_multiappend( &$xml, &$dnode, &$responses ) {
return true;
}
set_time_limit( 0 );
error_reporting( E_ALL );
//error_reporting( E_ALL ^ E_NOTICE );
......@@ -469,6 +501,9 @@ require_once( "includes/messages.{$lang}.inc.php" );
require_once( "{$include_path}/tools/functions.time.inc.php" );
$st = getmicrotime();
$callnum = 0;
$calltime = 0;
$multicallnum = 0;
if ( isset( $_REQUEST["mod"] ) ) {
$mod = $_REQUEST["mod"];
......@@ -592,8 +627,8 @@ switch ( $mod ) {
}
case "addtorrent" : {
$request = xmlrpc_encode_request( "get_directory", array() );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$directory = xmlrpc_decode( $response );
if ( substr( $directory, -1 ) == "/" ) {
$directory = substr( $directory, 0, -1 );
......@@ -608,12 +643,6 @@ switch ( $mod ) {
} elseif ( substr( $directory, 0, 2 ) == "./" ) {
$directory = substr( $directory, 2 );
$directory = "{$si_responses["get_cwd"]}/{$directory}";
} elseif ( substr( $directory, 0, strlen( "{$home_path}{$_SESSION["rtwi_nick"]}" ) ) == "{$home_path}{$_SESSION["rtwi_nick"]}" ) {
$directory = "{$directory}";
} else {
$_SESSION["rtwi_err"] = "badrtdirectory";
header( "location: {$url["index"]}" );
exit;
}
$directory = str_replace( "//", "/", $directory );
......@@ -666,12 +695,12 @@ switch ( $mod ) {
// retrieving server info
$methodlist = $xmlrpc_methods["si"];
$si_responses = xmlrpc_multicall( $xmlrpc_array, $methodlist );
$si_responses = xmlrpc_multicall( $xmlrpc_array, $methodlist, $multicallnum, $callnum, $calltime );
$methodlist = $xmlrpc_methods["d"];
$request = xmlrpc_encode_request( "d.multicall", array_merge( array( $_SESSION["rtwi_view"] ), $methodlist ) );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$response = xmlrpc_decode( $response );
$bytes_down = 0;
......@@ -713,27 +742,34 @@ switch ( $mod ) {
$node = $node->appendChild( $xml->createElement( "directory" ) );
$node->setAttribute( "dirname", $torrent["d_directory_value"] );
$fst = getmicrotime();
$methodlist = $xmlrpc_methods["f"];
$request = xmlrpc_encode_request( "f.multicall", array_merge( array( $torrent["d_hash"], 0 ), $methodlist ) );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$response = xmlrpc_decode( $response );
for ( $i = 0; $i < count( $response ); $i++ ) {
for ( $r = 0; $r < count( $methodlist ); $r++ ) {
$methodval = preg_replace( "/(.)\.get_(.*)=/", "$1_$2", $methodlist[$r] );
$methodval = preg_replace( "/(.)\.(get|is)_(.*)=/", "$1_$3", $methodlist[$r] );
$responses[$i][$methodval] = $response[$i][$r];
}
}
for ( $i = 0; $i < $torrent["d_size_files"]; $i++ ) {
prepare_f_responses( $responses[$i], $message, $home_path, $si_response["get_cwd"] );
$fnode = build_xmltree( $responses[$i]["f_path_components"], $node, $xml );
//$fnode = $node->appendChild( $xml->createElement( "file" ) );
//$fnode->setAttribute( "filename", $responses[$i]["f_path"] );
if ( $dodirtree === true ) {
$fnode = build_xmltree( $responses[$i]["f_path_components"], $node, $xml );
} else {
$fnode = $node->appendChild( $xml->createElement( "file" ) );
$fnode->setAttribute( "filename", $responses[$i]["f_path"] );
}
$fnode->setAttribute( "id", $i );
xmlrpc_multiappend( $xml, $fnode, $responses[$i] );
}
$ftt = getmicrotime();
break;
}
case "trackers" : {
......@@ -743,8 +779,8 @@ switch ( $mod ) {
$methodlist = $xmlrpc_methods["t"];
$request = xmlrpc_encode_request( "t.multicall", array_merge( array( $torrent["d_hash"], 0 ), $methodlist ) );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$response = xmlrpc_decode( $response );
for ( $i = 0; $i < count( $response ); $i++ ) {
for ( $r = 0; $r < count( $methodlist ); $r++ ) {
......@@ -809,42 +845,42 @@ switch ( $mod ) {
if ( $id >= 0 ) {
// retrieving server info
$methodlist = $xmlrpc_methods["si"];
$si_responses = xmlrpc_multicall( $xmlrpc_array, $methodlist );
$si_responses = xmlrpc_multicall( $xmlrpc_array, $methodlist, $multicallnum, $callnum, $calltime );
$request = xmlrpc_encode_request( "download_list", array( $_SESSION["rtwi_view"] ) );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$torrents = xmlrpc_decode( $response );
if ( in_array( $hash, $torrents ) ) {
// getting name
$request = xmlrpc_encode_request( "d.get_name", $hash );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$d_name = xmlrpc_decode( $response );
// getting download directory
$request = xmlrpc_encode_request( "d.get_directory", $hash );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$d_directory = xmlrpc_decode( $response );
//getting path
$request = xmlrpc_encode_request( "f.get_path", array( $hash, $id ) );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$f_path = xmlrpc_decode( $response );
//getting path
$request = xmlrpc_encode_request( "f.get_frozen_path", array( $hash, $id ) );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$f_frozen_path = xmlrpc_decode( $response );
//getting file size
$request = xmlrpc_encode_request( "f.get_size_bytes", array( $hash, $id ) );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$f_size_bytes = xmlrpc_decode( $response );
$d_directory_value = make_abs_path( $d_directory, $si_responses["get_cwd"], "{$home_path}{$_SESSION["rtwi_nick"]}" );
......@@ -866,12 +902,12 @@ switch ( $mod ) {
// retrieving server info
$methodlist = $xmlrpc_methods["si"];
$si_responses = xmlrpc_multicall( $xmlrpc_array, $methodlist );
$si_responses = xmlrpc_multicall( $xmlrpc_array, $methodlist, $multicallnum, $callnum, $calltime );
$methodlist = array( "d.get_down_rate=", "d.get_up_rate=" );
$request = xmlrpc_encode_request( "d.multicall", array_merge( array( $_SESSION["rtwi_view"] ), $methodlist ) );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$response = xmlrpc_decode( $response );
$bytes_down = 0;
......@@ -918,12 +954,12 @@ switch ( $mod ) {
// retrieving server info
$methodlist = $xmlrpc_methods["si"];
$si_responses = xmlrpc_multicall( $xmlrpc_array, $methodlist );
$si_responses = xmlrpc_multicall( $xmlrpc_array, $methodlist, $multicallnum, $callnum, $calltime );
$methodlist = $xmlrpc_methods["d"];
$request = xmlrpc_encode_request( "d.multicall", array_merge( array( $_SESSION["rtwi_view"] ), $methodlist ) );
$response = xmlrpc_call( $xmlrpc_array, $request );
$response = str_replace( "i8", "double", $response );
$response = xmlrpc_call( $xmlrpc_array, $request, $callnum, $calltime );
$response = preg_replace( "/i8|ex\.i8/", "string", $response );
$response = xmlrpc_decode( $response );
$bytes_down = 0;
......@@ -976,6 +1012,7 @@ if ( $ajax === false && $mod != "getfile" ) {
$_SESSION["rtwi_lastpage"] = $_SERVER["REQUEST_URI"];
}
$tt = getmicrotime();
//printf( "Total time: %0.6f sec\r\n", $tt - $st );
......@@ -1010,6 +1047,14 @@ if ( $mod != "getfile" ) {
}
$tt = getmicrotime();
//printf( "<br />\r\nTotal time: %0.6f sec", $tt - $st );
/*
printf( "<br />\r\nXMLRPC calls: %d (%d multicall)", $callnum, $multicallnum );
printf( "<br />\r\nXMLRPC time: %0.6f sec", $calltime );
if( isset( $fst ) && isset( $ftt ) ) {
printf( "<br />\r\nFiles time: %0.6f sec", $ftt - $fst );
}
printf( "<br />\r\nTotal time: %0.6f sec", $tt - $st );
*/
?>
This diff is collapsed.
function toggle( modpage ) {
switch ( modpage ) {
case 'torrent_info' :
case 'torrent_trackers' :
case '_info' : {
document.getElementById( 'throttleupinput' ).style.display = 'none';
document.getElementById( 'throttledowninput' ).style.display = 'none';
document.getElementById( 'tsubmit' ).style.display = 'none';
document.getElementById( 'throttleup' ).style.display = '';
document.getElementById( 'throttledown' ).style.display = '';
break;
}
case '_info_restore' : {
document.getElementById( 'throttleupinput' ).style.display = '';
document.getElementById( 'throttledowninput' ).style.display = '';
document.getElementById( 'tsubmit' ).style.display = '';
document.getElementById( 'throttleup' ).style.display = 'none';
document.getElementById( 'throttledown' ).style.display = 'none';
break;
}
case 'addtorrent_info' : {
document.getElementById( 'torrenturl' ).style.display = 'none';
break;
}
case 'torrent_files' : {
......@@ -11,6 +34,14 @@ function toggle( modpage ) {
uls.item( i ).style.display='none';
}
}
document.getElementById( 'throttleupinput' ).style.display = 'none';
document.getElementById( 'throttledowninput' ).style.display = 'none';
document.getElementById( 'tsubmit' ).style.display = 'none';
document.getElementById( 'throttleup' ).style.display = '';
document.getElementById( 'throttledown' ).style.display = '';
break;
}
}
......
......@@ -47,6 +47,11 @@ a {
text-decoration: none;
}
form {
margin: 0;
padding: 0;
}
a:hover {
color: #a0a0a0;
}
......@@ -133,6 +138,10 @@ select.whiteselect {
float: left;
}
#doonalltorrentform {
float: right;
}
.clr {
clear: both;
height: 1px;
......@@ -170,6 +179,11 @@ select.whiteselect {
margin: 0 1em 0 0;
}
.tthrottle input[type="text"] {
width: 2em;
text-align: right;
}
.trates_total {
float: left;
}
......@@ -238,8 +252,15 @@ select.whiteselect {
text-align: right;
}
.tselect {
float: right;
font-size: smaller;
text-align: right;
}
.tpriority {
float: right;
margin: 0 0 0 .5em;