From d1ac57cba4ca999daca9f6d0c17d93674ec20686 Mon Sep 17 00:00:00 2001 From: naddy Date: Sat, 23 Dec 2006 19:39:47 +0000 Subject: [PATCH] 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.) --- net/rtorrent/Makefile | 5 +-- .../patches/patch-src_core_download_list_cc | 34 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 net/rtorrent/patches/patch-src_core_download_list_cc diff --git a/net/rtorrent/Makefile b/net/rtorrent/Makefile index 80f308d55c6..87e4f72ab3d 100644 --- a/net/rtorrent/Makefile +++ b/net/rtorrent/Makefile @@ -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 diff --git a/net/rtorrent/patches/patch-src_core_download_list_cc b/net/rtorrent/patches/patch-src_core_download_list_cc new file mode 100644 index 00000000000..77f2958d4b5 --- /dev/null +++ b/net/rtorrent/patches/patch-src_core_download_list_cc @@ -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.");