* core::DownloadList::receive_hash_done(...) now handles failed

initial hash checks properly, rather than throwing an exception.

* Explicitly allocate Bitfield::m_data and dis-associate it from the
size. This will allow us to store m_size and m_set without the
underlying bitfield.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@700 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-05-23 17:26:38 +00:00
parent e4c5c80688
commit aaaf5d9a5d
+8 -1
View File
@@ -374,9 +374,16 @@ DownloadList::hash_done(Download* download) {
if (!download->is_open())
throw torrent::client_error("DownloadList::hash_done(...) !download->is_open().");
if (!download->is_hash_checked() || download->is_hash_checking() || download->is_active())
if (download->is_hash_checking() || download->is_active())
throw torrent::client_error("DownloadList::hash_done(...) download in invalid state.");
if (!download->is_hash_checked()) {
download->set_hash_failed(true);
std::for_each(slot_map_hash_done().begin(), slot_map_hash_done().end(), download_list_call(download));
return;
}
// Need to find some sane conditional here. Can we check the total
// downloaded to ensure something was transferred, thus we didn't
// just hash an already completed torrent with lacking session data?