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

rtwi-0.3.7-120621

parent 2c34a2ac
......@@ -55,7 +55,6 @@ function prepare_serverinfo_responses( &$responses, &$message, &$config ) {
$bytes_down_arr = switch_bytes( $responses["bytes_down"] );
$bytes_up_arr = switch_bytes( $responses["bytes_up"] );
$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"] );
......@@ -70,8 +69,6 @@ function prepare_serverinfo_responses( &$responses, &$message, &$config ) {
$responses["bytes_up_suffix"] = $bytes_up_arr[1];
$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] );
......@@ -104,8 +101,8 @@ function prepare_serverinfo_responses( &$responses, &$message, &$config ) {
$responses["proxy_address_value"] = $responses["proxy_address"] == "0.0.0.0" ? $message["proxy_address_0000"] : $responses["proxy_address"];
$responses["tracker_numwant_value"] = $responses["tracker_numwant"] == -1 ? $message["disabled"] : $responses["tracker_numwant"];
$responses["directory_value"] = myrealpath( $responses["directory"], $config["home_path"], $responses["get_cwd"] );
$responses["session_value"] = myrealpath( $responses["session"], $config["home_path"], $responses["get_cwd"] );
$responses["directory_value"] = myrealpath( $responses["directory"], $config["home_path"], $responses["cwd"] );
$responses["session_value"] = myrealpath( $responses["session"], $config["home_path"], $responses["cwd"] );
if ( $responses["max_file_size"] == -1 ) {
$responses["max_file_size_value"] = $message["disabled"];
......@@ -461,8 +458,8 @@ $multicallnum = 0;
// initializing xmlrpc methods
$xmlrpc_methods = array(
"si" => $config["dht"] === "1" ?
array( "dht_statistics", "get_bind", "get_check_hash", "get_connection_leech", "get_connection_seed", "get_dht_port", "get_directory", "get_download_rate", "get_hash_interval", "get_hash_max_tries", "get_hash_read_ahead", "get_http_cacert", "get_http_capath", "get_http_proxy", "get_ip", "get_max_downloads_div", "get_max_downloads_global", "get_max_file_size", "get_max_memory_usage", "get_max_open_files", "get_max_open_http", "get_max_open_sockets", "get_max_peers", "get_max_peers_seed", "get_max_uploads", "get_max_uploads_div", "get_max_uploads_global", "get_memory_usage", "get_min_peers", "get_min_peers_seed", "get_name", "get_peer_exchange", "get_port_open", "get_port_random", "get_port_range", "get_preload_min_size", "get_preload_required_rate", "get_preload_type", "get_proxy_address", "get_receive_buffer_size", "get_safe_sync", "get_scgi_dont_route", "get_send_buffer_size", "get_session", "get_session_lock", "get_session_on_completion", "get_split_file_size", "get_split_suffix", "get_stats_not_preloaded", "get_stats_preloaded", "get_timeout_safe_sync", "get_timeout_sync", "get_tracker_numwant", "get_upload_rate", "get_use_udp_trackers", "system.client_version", "system.cwd", "system.hostname", "system.library_version", "system.pid", "view_list" ) :
array( "get_bind", "get_check_hash", "get_connection_leech", "get_connection_seed", "get_directory", "get_download_rate", "get_hash_interval", "get_hash_max_tries", "get_hash_read_ahead", "get_http_cacert", "get_http_capath", "get_http_proxy", "get_ip", "get_max_downloads_div", "get_max_downloads_global", "get_max_file_size", "get_max_memory_usage", "get_max_open_files", "get_max_open_http", "get_max_open_sockets", "get_max_peers", "get_max_peers_seed", "get_max_uploads", "get_max_uploads_div", "get_max_uploads_global", "get_memory_usage", "get_min_peers", "get_min_peers_seed", "get_name", "get_peer_exchange", "get_port_open", "get_port_random", "get_port_range", "get_preload_min_size", "get_preload_required_rate", "get_preload_type", "get_proxy_address", "get_receive_buffer_size", "get_safe_sync", "get_scgi_dont_route", "get_send_buffer_size", "get_session", "get_session_lock", "get_session_on_completion", "get_split_file_size", "get_split_suffix", "get_stats_not_preloaded", "get_stats_preloaded", "get_timeout_safe_sync", "get_timeout_sync", "get_tracker_numwant", "get_upload_rate", "get_use_udp_trackers", "system.client_version", "system.cwd", "system.hostname", "system.library_version", "system.pid", "view_list" ),
array( "dht_statistics", "get_bind", "get_check_hash", "get_connection_leech", "get_connection_seed", "get_dht_port", "get_directory", "get_download_rate", "get_http_cacert", "get_http_capath", "get_http_proxy", "get_ip", "get_max_downloads_div", "get_max_downloads_global", "get_max_file_size", "get_max_memory_usage", "get_max_open_files", "get_max_open_http", "get_max_open_sockets", "get_max_peers", "get_max_peers_seed", "get_max_uploads", "get_max_uploads_div", "get_max_uploads_global", "get_memory_usage", "get_min_peers", "get_min_peers_seed", "get_name", "get_peer_exchange", "get_port_open", "get_port_random", "get_port_range", "get_preload_min_size", "get_preload_required_rate", "get_preload_type", "get_proxy_address", "get_receive_buffer_size", "get_safe_sync", "get_scgi_dont_route", "get_send_buffer_size", "get_session", "get_session_lock", "get_session_on_completion", "get_split_file_size", "get_split_suffix", "get_stats_not_preloaded", "get_stats_preloaded", "get_timeout_safe_sync", "get_timeout_sync", "get_tracker_numwant", "get_upload_rate", "get_use_udp_trackers", "system.client_version", "system.cwd", "system.hostname", "system.library_version", "system.pid", "view_list" ) :
array( "get_bind", "get_check_hash", "get_connection_leech", "get_connection_seed", "get_directory", "get_download_rate", "get_http_cacert", "get_http_capath", "get_http_proxy", "get_ip", "get_max_downloads_div", "get_max_downloads_global", "get_max_file_size", "get_max_memory_usage", "get_max_open_files", "get_max_open_http", "get_max_open_sockets", "get_max_peers", "get_max_peers_seed", "get_max_uploads", "get_max_uploads_div", "get_max_uploads_global", "get_memory_usage", "get_min_peers", "get_min_peers_seed", "get_name", "get_peer_exchange", "get_port_open", "get_port_random", "get_port_range", "get_preload_min_size", "get_preload_required_rate", "get_preload_type", "get_proxy_address", "get_receive_buffer_size", "get_safe_sync", "get_scgi_dont_route", "get_send_buffer_size", "get_session", "get_session_lock", "get_session_on_completion", "get_split_file_size", "get_split_suffix", "get_stats_not_preloaded", "get_stats_preloaded", "get_timeout_safe_sync", "get_timeout_sync", "get_tracker_numwant", "get_upload_rate", "get_use_udp_trackers", "system.client_version", "system.cwd", "system.hostname", "system.library_version", "system.pid", "view_list" ),
"d" => array( "d.get_base_filename=", "d.get_base_path=", "d.get_bytes_done=", "d.get_chunk_size=", "d.get_chunks_hashed=", "d.get_complete=", "d.get_completed_bytes=", "d.get_completed_chunks=", "d.get_connection_current=", "d.get_connection_leech=", "d.get_connection_seed=", "d.get_creation_date=", "d.get_custom1=", "d.get_custom2=", "d.get_custom3=", "d.get_custom4=", "d.get_custom5=", "d.get_directory=", "d.get_down_rate=", "d.get_down_total=", "d.get_free_diskspace=", "d.get_hash=", "d.get_hashing=", "d.get_ignore_commands=", "d.get_left_bytes=", "d.get_local_id=", "d.get_local_id_html=", "d.get_max_file_size=", "d.get_max_size_pex=", "d.get_message=", "d.get_name=", "d.get_peer_exchange=", "d.get_peers_accounted=", "d.get_peers_complete=", "d.get_peers_connected=", "d.get_peers_max=", "d.get_peers_min=", "d.get_peers_not_connected=", "d.get_priority=", "d.get_priority_str=", "d.get_ratio=", "d.get_size_bytes=", "d.get_size_chunks=", "d.get_size_files=", "d.get_size_pex=", "d.get_skip_rate=", "d.get_skip_total=", "d.get_state=", "d.get_state_changed=", "d.get_tied_to_file=", "d.get_tracker_focus=", "d.get_tracker_numwant=", "d.get_tracker_size=", "d.get_up_rate=", "d.get_up_total=", "d.get_uploads_max=", "d.is_active=", "d.is_hash_checked=", "d.is_hash_checking=", "d.is_multi_file=", "d.is_open=", "d.is_pex_active=", "d.is_private=" ),
"f" => array( "f.get_completed_chunks=", "f.get_frozen_path=", "f.is_created=", "f.is_open=", "f.get_last_touched=", "f.get_match_depth_next=", "f.get_match_depth_prev=", "f.get_offset=", "f.get_path=", "f.get_path_components=", "f.get_path_depth=", "f.get_priority=", "f.get_range_first=", "f.get_range_second=", "f.get_size_bytes=", "f.get_size_chunks=" ),
"p" => array( "p.get_address=", "p.get_client_version=", "p.get_completed_percent=", "p.get_down_rate=", "p.get_down_total=", "p.get_id=", "p.get_id_html=", "p.get_options_str=", "p.get_peer_rate=", "p.get_peer_total=", "p.get_port=", "p.get_up_rate=", "p.get_up_total=", "p.is_encrypted=", "p.is_incoming=", "p.is_obfuscated=", "p.is_snubbed=" ),
......@@ -795,7 +792,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
// when we have a match
if ( is_array( $torrent ) ) {
// prepare download variables
prepare_downloadlist_responses( $torrent, $message, $config["home_path"], $si_responses["get_cwd"] );
prepare_downloadlist_responses( $torrent, $message, $config["home_path"], $si_responses["cwd"] );
// decide what to do
switch ( $page ) {
case "peers" : { // peer list page
......@@ -865,7 +862,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
// build som kind of struct
$dstruct = array();
for ( $i = 0; $i < $torrent["d_size_files"]; $i++ ) {
prepare_filelist_responses( $responses[$i], $message, $home_path, $si_responses["get_cwd"] );
prepare_filelist_responses( $responses[$i], $message, $home_path, $si_responses["cwd"] );
$n = 0;
$tmp = &$dstruct;
......@@ -999,7 +996,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
$response = $xmlrpc->mfetch( $xmlrpc_methods["g"] );
// getting the absolute path of the download's directory
$d_directory_value = myrealpath( $response["d_directory"], $config["home_path"], $si_responses["get_cwd"] );
$d_directory_value = myrealpath( $response["d_directory"], $config["home_path"], $si_responses["cwd"] );
} else {
$_SESSION["rtwi_err"] = "nohashfound";
$layout_file = "layout.main.index.xsl";
......@@ -1049,7 +1046,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
$bytes_up += $d_responses[$i]["d_up_rate"];
// formatting and inserting values to xml
prepare_downloadlist_responses( $d_responses[$i], $message, $home_path, $si_responses["get_cwd"] );
prepare_downloadlist_responses( $d_responses[$i], $message, $home_path, $si_responses["cwd"] );
$ttnode = $tnode->appendChild( $xml->createElement( "torrent" ) );
xmlrpc_multiappend( $xml, $ttnode, $d_responses[$i] );
}
......
......@@ -260,7 +260,7 @@ switch ( $_REQUEST["mod"] ) {
}
$torrents = $xmlrpc->fetch();
if ( !$xmlrpc->setmrequest( array( "get_directory", "system.cwd" ) ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
if ( !$xmlrpc->setmrequest( array( "get_directory", "system.get_cwd" ) ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
header( "location: {$config["index"]}?mod=addtorrent}" );
exit;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment