mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-13 04:36:16 +00:00
Merge branch 'master' into xirvik
This commit is contained in:
+14
-14
@@ -178,7 +178,7 @@ DownloadList::iterator
|
|||||||
DownloadList::insert(Download* download) {
|
DownloadList::insert(Download* download) {
|
||||||
iterator itr = base_type::insert(end(), download);
|
iterator itr = base_type::insert(end(), download);
|
||||||
|
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Inserting download.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Inserting download.");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
(*itr)->data()->slot_initial_hash() = tr1::bind(&DownloadList::hash_done, this, download);
|
(*itr)->data()->slot_initial_hash() = tr1::bind(&DownloadList::hash_done, this, download);
|
||||||
@@ -210,7 +210,7 @@ DownloadList::erase(iterator itr) {
|
|||||||
if (itr == end())
|
if (itr == end())
|
||||||
throw torrent::internal_error("DownloadList::erase(...) could not find download.");
|
throw torrent::internal_error("DownloadList::erase(...) could not find download.");
|
||||||
|
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, (*itr)->info(), "->download_list: Erasing download.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, (*itr)->info(), "download_list", "Erasing download.");
|
||||||
|
|
||||||
// Makes sure close doesn't restart hashing of this download.
|
// Makes sure close doesn't restart hashing of this download.
|
||||||
(*itr)->set_hash_failed(true);
|
(*itr)->set_hash_failed(true);
|
||||||
@@ -246,7 +246,7 @@ void
|
|||||||
DownloadList::open_throw(Download* download) {
|
DownloadList::open_throw(Download* download) {
|
||||||
check_contains(download);
|
check_contains(download);
|
||||||
|
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Opening download.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Opening download.");
|
||||||
|
|
||||||
if (download->download()->info()->is_open())
|
if (download->download()->info()->is_open())
|
||||||
return;
|
return;
|
||||||
@@ -272,7 +272,7 @@ DownloadList::close(Download* download) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
DownloadList::close_directly(Download* download) {
|
DownloadList::close_directly(Download* download) {
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Closing download directly.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Closing download directly.");
|
||||||
|
|
||||||
if (download->download()->info()->is_active()) {
|
if (download->download()->info()->is_active()) {
|
||||||
download->download()->stop(torrent::Download::stop_skip_tracker);
|
download->download()->stop(torrent::Download::stop_skip_tracker);
|
||||||
@@ -287,7 +287,7 @@ DownloadList::close_directly(Download* download) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
DownloadList::close_quick(Download* download) {
|
DownloadList::close_quick(Download* download) {
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Closing download quickly.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Closing download quickly.");
|
||||||
close(download);
|
close(download);
|
||||||
|
|
||||||
// Make sure we cancel any tracker requests. This should rather be
|
// Make sure we cancel any tracker requests. This should rather be
|
||||||
@@ -301,7 +301,7 @@ void
|
|||||||
DownloadList::close_throw(Download* download) {
|
DownloadList::close_throw(Download* download) {
|
||||||
check_contains(download);
|
check_contains(download);
|
||||||
|
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Closing download with throw.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Closing download with throw.");
|
||||||
|
|
||||||
// When pause gets called it will clear the initial hash check state
|
// When pause gets called it will clear the initial hash check state
|
||||||
// and set hash failed. This should ensure hashing doesn't restart
|
// and set hash failed. This should ensure hashing doesn't restart
|
||||||
@@ -334,7 +334,7 @@ void
|
|||||||
DownloadList::resume(Download* download, int flags) {
|
DownloadList::resume(Download* download, int flags) {
|
||||||
check_contains(download);
|
check_contains(download);
|
||||||
|
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Resuming download: flags:%0x.", flags);
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Resuming download: flags:%0x.", flags);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -429,7 +429,7 @@ void
|
|||||||
DownloadList::pause(Download* download, int flags) {
|
DownloadList::pause(Download* download, int flags) {
|
||||||
check_contains(download);
|
check_contains(download);
|
||||||
|
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Pausing download: flags:%0x.", flags);
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Pausing download: flags:%0x.", flags);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -478,7 +478,7 @@ void
|
|||||||
DownloadList::check_hash(Download* download) {
|
DownloadList::check_hash(Download* download) {
|
||||||
check_contains(download);
|
check_contains(download);
|
||||||
|
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Checking hash.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Checking hash.");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (rpc::call_command_value("d.hashing", rpc::make_target(download)) != Download::variable_hashing_stopped)
|
if (rpc::call_command_value("d.hashing", rpc::make_target(download)) != Download::variable_hashing_stopped)
|
||||||
@@ -495,7 +495,7 @@ void
|
|||||||
DownloadList::hash_done(Download* download) {
|
DownloadList::hash_done(Download* download) {
|
||||||
check_contains(download);
|
check_contains(download);
|
||||||
|
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Hash done.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Hash done.");
|
||||||
|
|
||||||
if (download->is_hash_checking() || download->is_active())
|
if (download->is_hash_checking() || download->is_active())
|
||||||
throw torrent::internal_error("DownloadList::hash_done(...) download in invalid state.");
|
throw torrent::internal_error("DownloadList::hash_done(...) download in invalid state.");
|
||||||
@@ -571,7 +571,7 @@ void
|
|||||||
DownloadList::hash_queue(Download* download, int type) {
|
DownloadList::hash_queue(Download* download, int type) {
|
||||||
check_contains(download);
|
check_contains(download);
|
||||||
|
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Hash queue.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Hash queue.");
|
||||||
|
|
||||||
if (rpc::call_command_value("d.hashing", rpc::make_target(download)) != Download::variable_hashing_stopped)
|
if (rpc::call_command_value("d.hashing", rpc::make_target(download)) != Download::variable_hashing_stopped)
|
||||||
throw torrent::internal_error("DownloadList::hash_queue(...) hashing already queued.");
|
throw torrent::internal_error("DownloadList::hash_queue(...) hashing already queued.");
|
||||||
@@ -602,7 +602,7 @@ void
|
|||||||
DownloadList::received_finished(Download* download) {
|
DownloadList::received_finished(Download* download) {
|
||||||
check_contains(download);
|
check_contains(download);
|
||||||
|
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Received finished.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Received finished.");
|
||||||
|
|
||||||
if (rpc::call_command_value("pieces.hash.on_completion"))
|
if (rpc::call_command_value("pieces.hash.on_completion"))
|
||||||
// Set some 'checking_finished_thingie' variable to make hash_done
|
// Set some 'checking_finished_thingie' variable to make hash_done
|
||||||
@@ -617,7 +617,7 @@ void
|
|||||||
DownloadList::confirm_finished(Download* download) {
|
DownloadList::confirm_finished(Download* download) {
|
||||||
check_contains(download);
|
check_contains(download);
|
||||||
|
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Confirming finished.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Confirming finished.");
|
||||||
|
|
||||||
if (download->download()->info()->is_meta_download())
|
if (download->download()->info()->is_meta_download())
|
||||||
return process_meta_download(download);
|
return process_meta_download(download);
|
||||||
@@ -690,7 +690,7 @@ DownloadList::confirm_finished(Download* download) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
DownloadList::process_meta_download(Download* download) {
|
DownloadList::process_meta_download(Download* download) {
|
||||||
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Processing meta download.");
|
lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Processing meta download.");
|
||||||
|
|
||||||
rpc::call_command("d.stop", torrent::Object(), rpc::make_target(download));
|
rpc::call_command("d.stop", torrent::Object(), rpc::make_target(download));
|
||||||
rpc::call_command("d.close", torrent::Object(), rpc::make_target(download));
|
rpc::call_command("d.close", torrent::Object(), rpc::make_target(download));
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ SCgiTask::event_read() {
|
|||||||
result = write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n"));
|
result = write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
lt_log_print_dump(torrent::LOG_RPC_DEBUG, m_body, m_bufferSize - std::distance(m_buffer, m_body), "SCGI RPC read.", 0);
|
lt_log_print_dump(torrent::LOG_RPC_DEBUG, m_body, m_bufferSize - std::distance(m_buffer, m_body), "scgi", "RPC read.", 0);
|
||||||
|
|
||||||
// Close if the call failed, else stay open to write back data.
|
// Close if the call failed, else stay open to write back data.
|
||||||
if (!m_parent->receive_call(this, m_body, m_bufferSize - std::distance(m_buffer, m_body)))
|
if (!m_parent->receive_call(this, m_body, m_bufferSize - std::distance(m_buffer, m_body)))
|
||||||
@@ -246,7 +246,7 @@ SCgiTask::receive_write(const char* buffer, uint32_t length) {
|
|||||||
result = write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n"));
|
result = write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
lt_log_print_dump(torrent::LOG_RPC_DEBUG, m_buffer, m_bufferSize, "SCGI RPC write.", 0);
|
lt_log_print_dump(torrent::LOG_RPC_DEBUG, m_buffer, m_bufferSize, "scgi", "RPC write.", 0);
|
||||||
|
|
||||||
event_write();
|
event_write();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user