From upstream changeset 828:

Fixed a bug caused by gcc-3.3.5 miscompiling the exception thrown.
(Invalid torrent files will now produce an error rather than crashing
rtorrent.)
This commit is contained in:
naddy 2006-12-23 19:39:47 +00:00
parent 5c44c9adb4
commit d1ac57cba4
2 changed files with 37 additions and 2 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.11 2006/12/21 19:13:07 naddy Exp $
# $OpenBSD: Makefile,v 1.12 2006/12/23 19:39:47 naddy Exp $
COMMENT= "Ncurses BitTorrent Client based on LibTorrent"
DISTNAME= rtorrent-0.7.0
PKGNAME= ${DISTNAME}p0
CATEGORIES= net
HOMEPAGE= http://libtorrent.rakshasa.no/
@ -19,7 +20,7 @@ WANTLIB= c crypto m ncurses sigc-2.0 ssl stdc++ z
MASTER_SITES= ${HOMEPAGE}downloads/
LIB_DEPENDS= torrent.>=11::net/libtorrent \
curl.>=3::net/curl
curl.>=5::net/curl
USE_LIBTOOL= Yes
CONFIGURE_STYLE= gnu

View File

@ -0,0 +1,34 @@
$OpenBSD: patch-src_core_download_list_cc,v 1.1 2006/12/23 19:39:47 naddy Exp $
--- src/core/download_list.cc.orig Sat Dec 23 18:16:03 2006
+++ src/core/download_list.cc Sat Dec 23 18:18:24 2006
@@ -95,10 +95,17 @@ DownloadList::create(std::istream* str,
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);
} catch (torrent::local_error& e) {
@@ -389,9 +396,6 @@ DownloadList::check_hash(Download* downl
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.");