From ba4a1927ff13b19e5ebfa3315558932326366bc5 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Mon, 15 May 2006 17:55:11 +0000 Subject: [PATCH] * Set the hash failed flag before DownloadList::hash_clear closes the torrent, so the hashing queue doesn't re-open it. * Randomized the starting position in chunk selector. * Added man page entry for send/receive buffer size. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@689 e378c898-3ddf-0310-93e7-cc216c733640 --- doc/rtorrent.1.xml | 10 ++++++++++ src/core/download_list.cc | 7 +++++++ src/core/manager.cc | 3 +++ 3 files changed, 20 insertions(+) diff --git a/doc/rtorrent.1.xml b/doc/rtorrent.1.xml index 3ec568d9..74e1385c 100644 --- a/doc/rtorrent.1.xml +++ b/doc/rtorrent.1.xml @@ -739,6 +739,16 @@ gives the client 128 sockets to use as it wishes. + + send_buffer_size = value + receive_buffer_size = value + + +Adjust the send and receive buffer size for socket. + + + + umask = 0644 diff --git a/src/core/download_list.cc b/src/core/download_list.cc index 3858e628..85853d50 100644 --- a/src/core/download_list.cc +++ b/src/core/download_list.cc @@ -432,11 +432,18 @@ void DownloadList::hash_clear(Download* download) { check_contains(download); + // Set hash failed so close_throw won't cause the hash queue to + // reopen this download. + download->set_hash_failed(true); + close_throw(download); download->download()->hash_resume_clear(); download->set_hash_failed(false); + if (download->is_open()) + throw torrent::internal_error("DownloadList::hash_clear(...) download still open."); + // If any more stuff is added here, make sure resume etc are still // correct. std::for_each(slot_map_hash_queued().begin(), slot_map_hash_queued().end(), download_list_call(download)); diff --git a/src/core/manager.cc b/src/core/manager.cc index 7a5992b1..36313109 100644 --- a/src/core/manager.cc +++ b/src/core/manager.cc @@ -385,6 +385,9 @@ Manager::receive_hashing_changed() { if ((*itr)->is_hash_checked()) throw torrent::client_error("core::Manager::receive_hashing_changed() hash already checked."); + if ((*itr)->is_hash_failed()) + continue; + m_downloadList->open_throw(*itr); (*itr)->download()->hash_check();