From fbf1a8b8a67485d14e47ea4409f347402d1656da Mon Sep 17 00:00:00 2001 From: rakshasa Date: Mon, 18 Dec 2006 15:32:31 +0000 Subject: [PATCH] * Fixed a bug caused by gcc-3.3.5 miscompiling the exception thrown in rtorrent/src/core/download_list.cc:100. * Disable encryption support when compiling libtorrent with --without-openssl. Patch by Josef Drexler, public domain as per earlier agreement. * Converted torrent::HashQueue from std::list into a std::deque for better cache locality. * Fixed a bug that would cause storage errors to trigger an internal_error being wrongly thrown. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@828 e378c898-3ddf-0310-93e7-cc216c733640 --- src/core/download_list.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/core/download_list.cc b/src/core/download_list.cc index 7199f158..4574e340 100644 --- a/src/core/download_list.cc +++ b/src/core/download_list.cc @@ -95,9 +95,16 @@ DownloadList::create(std::istream* str, bool printLog) { try { *str >> *object; - // Catch, delete. - if (str->fail()) - throw torrent::input_error("Could not create download, the input is not a valid torrent."); + // Don't throw input_error from here as gcc-3.3.5 produces bad + // code. + if (str->fail()) { + delete object; + + if (printLog) + control->core()->push_log("Could not create download, the input is not a valid torrent."); + + return NULL; + } download = torrent::download_add(object); @@ -390,9 +397,6 @@ void DownloadList::hash_done(Download* download) { check_contains(download); - if (!download->is_open()) - throw torrent::internal_error("DownloadList::hash_done(...) !download->is_open()."); - if (download->is_hash_checking() || download->is_active()) throw torrent::internal_error("DownloadList::hash_done(...) download in invalid state.");