diff options
author | 2008-08-26 21:17:16 +0000 | |
---|---|---|
committer | 2008-08-26 21:17:16 +0000 | |
commit | f767942abd21b97e92c6d6ccb8d6e48306430ed1 (patch) | |
tree | bc6bb095c2962504090e1a5afa58465e33a2601a /net-libs | |
parent | New pretest version. (diff) | |
download | historical-f767942abd21b97e92c6d6ccb8d6e48306430ed1.tar.gz historical-f767942abd21b97e92c6d6ccb8d6e48306430ed1.tar.bz2 historical-f767942abd21b97e92c6d6ccb8d6e48306430ed1.zip |
Fixes an interoperability issue in the get_peers handling, now it behaves according to the clarified BEP-0005. Also fixes a minor issue of not being able to generate error packets. Patch by Josef Drexler.
Package-Manager: portage-2.2_rc8/cvs/Linux 2.6.25.8 i686
Diffstat (limited to 'net-libs')
-rw-r--r-- | net-libs/libtorrent/ChangeLog | 11 | ||||
-rw-r--r-- | net-libs/libtorrent/Manifest | 4 | ||||
-rw-r--r-- | net-libs/libtorrent/files/libtorrent-0.12.2-fix_dht-get_peers.patch | 140 | ||||
-rw-r--r-- | net-libs/libtorrent/libtorrent-0.12.2-r4.ebuild | 60 |
4 files changed, 213 insertions, 2 deletions
diff --git a/net-libs/libtorrent/ChangeLog b/net-libs/libtorrent/ChangeLog index 16dce22f0cf7..622ab3b46842 100644 --- a/net-libs/libtorrent/ChangeLog +++ b/net-libs/libtorrent/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for net-libs/libtorrent # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-libs/libtorrent/ChangeLog,v 1.122 2008/08/25 20:19:48 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-libs/libtorrent/ChangeLog,v 1.123 2008/08/26 21:17:15 loki_val Exp $ + +*libtorrent-0.12.2-r4 (26 Aug 2008) + + 26 Aug 2008; Peter Alfredsen <loki_val@gentoo.org> + +files/libtorrent-0.12.2-fix_dht-get_peers.patch, + +libtorrent-0.12.2-r4.ebuild: + Fixes an interoperability issue in the get_peers handling, now it behaves + according to the clarified BEP-0005. Also fixes a minor issue of not being + able to generate error packets. Patch by Josef Drexler. 25 Aug 2008; Jeroen Roovers <jer@gentoo.org> libtorrent-0.12.2-r3.ebuild: Stable for HPPA (bug #233122). diff --git a/net-libs/libtorrent/Manifest b/net-libs/libtorrent/Manifest index 62a2590cb830..3c838c84f90f 100644 --- a/net-libs/libtorrent/Manifest +++ b/net-libs/libtorrent/Manifest @@ -1,6 +1,7 @@ AUX libtorrent-0.11.9+gcc-4.3.patch 3283 RMD160 bb48b1a0de3101fdc74989efd997a33f57765430 SHA1 44baef27e8d2ff1c76402d351305b8c95de9c432 SHA256 9468cf97b56bbaf125bfb7de2b70b8b8b87ba9d5eb1acab272a5208669007d54 AUX libtorrent-0.12.2-dht_bounds_fix.patch 870 RMD160 05e7d690a0f808ad293f0304f5eb31936b7c5850 SHA1 89b34f3d74140ceab993573c5eb1d6ceab366a21 SHA256 e8754b864b4108e779b8cfc4f49aac0a63fa0dc6702f3e7b0348477319f1ed54 AUX libtorrent-0.12.2-fix_cull.patch 568 RMD160 1f8b970a885df47f512721216dab6245a733e8d1 SHA1 4af00bdcece5bd4a905b8bf6cde016c5add6ffce SHA256 78cb8cdde1c5b98b4c9f2c96f8e192bd9e963f221c51583b57e61b5bde529e32 +AUX libtorrent-0.12.2-fix_dht-get_peers.patch 5297 RMD160 1a8880ad9c984b41bf1dc0fa471d13ff2b58f574 SHA1 f59fb584f87bf61e3bcd429d9c44c71e90ec8059 SHA256 b2696220308c61792a4c4cb750f0131f33be732decfb488b73957b9fb12bb978 AUX libtorrent-0.12.2-fix_dht_target.patch 1646 RMD160 7a15d31c1acba41dda0c39f938a2127f02cb8da4 SHA1 47304fca6bd005f396157c3e1cc9e60df92af45e SHA256 21727f361ead79315e971e2729f84eb71d94eec98c0f852842f6e78ce4011dea AUX libtorrent-0.12.2-fix_have_timer.patch 2116 RMD160 966f7203d3632adfad8a9be899462b974d9b1cd2 SHA1 9d6f220fe6aad5ea845973d3ab4c5fca98a5c390 SHA256 b4a3ad44765d98dd7dcd4e1361eecd2111ba65aecb123da575ad57cfd1864fbf AUX libtorrent-0.12.2-fix_pex_leak.patch 3987 RMD160 3374a25e5e3d41efd8af0704ed895e67924b62ca SHA1 ba32e66305e982a99b8281f14a6e60ad3780f817 SHA256 ebd65f89c9dbae4070c3293f412b96eaffc6eacc3acc7de8b5a9eba04c500f24 @@ -12,5 +13,6 @@ DIST libtorrent-0.11.9.tar.gz 545210 RMD160 fb8de66d65791dab67c195356a98de7cf653 DIST libtorrent-0.12.2.tar.gz 585374 RMD160 88cdc415f98afd8b87fa6d7330906737c3e434fa SHA1 a53d2c671e9f2dd971d0622d5b3672da91c46ef9 SHA256 cf9d2cd667fd6939a3e0bd27e48d0c7f35d9ab2f7affbb3214da03fd2c1360a8 EBUILD libtorrent-0.11.9.ebuild 1092 RMD160 da7b3481dc661adc564d9fe18b1af41bf9020ec0 SHA1 9d45afa155e37477e94dc9b8ff9d97e9f16a8260 SHA256 66270b7da8e7989c851b569e58f4a342d7080db6470be02998cb4c435120aabe EBUILD libtorrent-0.12.2-r3.ebuild 1594 RMD160 4b6b696be6342abee4c1a77a4e3e11c69958993e SHA1 23c314c013e5fe6184d4d0dc8754ebbe356885f2 SHA256 3e78d22de16d3d31af3e6897d412ad825e86d3c03f4716d9a28c98788a69d456 -MISC ChangeLog 18522 RMD160 2baf113820dc4123be95ad7deb850e85610917a5 SHA1 39ce03a603450c30f788a8500f00143b00a73517 SHA256 80d37646d498a108453ad882551a6cbcc3d15a8f0a4482579a09111313e687cf +EBUILD libtorrent-0.12.2-r4.ebuild 1655 RMD160 992d4124877763e21952216c0b5b0dba51eb7b01 SHA1 b9c386c7de14a05e465ec3e9387ac6a9b1a43de3 SHA256 ecb33650c31e3d1b4279fdfd8b656b5e532b5155cc681dfe3335e37e31fd6bbd +MISC ChangeLog 18913 RMD160 72b3576474c29835c3cf22aa9a4db843a88a072d SHA1 79a84e0dacf3a76f0b1fca02fa04126a8c1d56dc SHA256 f743ed681d8215c8e1481a4b256d24ba25c274fed0725ccf778baa9c17767ee1 MISC metadata.xml 436 RMD160 4546e998ce9c6303f4c91d7413b1f732bbb2a8aa SHA1 fb1f2cddef7e268bf64572615fbc3c326ed673fd SHA256 936fb95c2c44078d98c0c74d0b148744036d6a18d40b8b482d7656ef0e211bff diff --git a/net-libs/libtorrent/files/libtorrent-0.12.2-fix_dht-get_peers.patch b/net-libs/libtorrent/files/libtorrent-0.12.2-fix_dht-get_peers.patch new file mode 100644 index 000000000000..b447749f9495 --- /dev/null +++ b/net-libs/libtorrent/files/libtorrent-0.12.2-fix_dht-get_peers.patch @@ -0,0 +1,140 @@ +# Fixes an interoperability issue in the get_peers handling, now it +# behaves according to the clarified BEP-0005. Also fixes a minor +# issue of not being able to generate error packets. +Index: libtorrent/src/dht/dht_tracker.h +=================================================================== +--- libtorrent/src/dht/dht_tracker.h (revision 1063) ++++ libtorrent/src/dht/dht_tracker.h (working copy) +@@ -65,7 +65,7 @@ + size_t size() const { return m_peers.size(); } + + void add_peer(uint32_t addr, uint16_t port); +- std::string get_peers(unsigned int maxPeers = max_peers); ++ Object get_peers(unsigned int maxPeers = max_peers); + + // Remove old announces from the tracker that have not reannounced for + // more than the given number of seconds. +Index: libtorrent/src/dht/dht_transaction.cc +=================================================================== +--- libtorrent/src/dht/dht_transaction.cc (revision 1063) ++++ libtorrent/src/dht/dht_transaction.cc (working copy) +@@ -252,7 +252,7 @@ + } + + void +-DhtAnnounce::receive_peers(const std::string& peers) { ++DhtAnnounce::receive_peers(const Object& peers) { + m_tracker->receive_peers(peers); + } + +Index: libtorrent/src/dht/dht_server.cc +=================================================================== +--- libtorrent/src/dht/dht_server.cc (revision 1063) ++++ libtorrent/src/dht/dht_server.cc (working copy) +@@ -302,8 +302,7 @@ + reply.insert_key("nodes", std::string(compact, end)); + + } else { +- Object& values = reply.insert_key("values", Object::create_list()); +- values.insert_back(tracker->get_peers()); ++ reply.insert_key("values", Object::create_list()).as_list().swap(tracker->get_peers().as_list()); + } + } + +@@ -417,7 +416,7 @@ + transaction->complete(true); + + if (response.has_key_list("values")) +- announce->receive_peers((*response.get_key_list("values").begin()).as_string()); ++ announce->receive_peers(response.get_key("values")); + + if (response.has_key_string("token")) + add_transaction(new DhtTransactionAnnouncePeer(transaction->id(), transaction->address(), announce->target(), response.get_key_string("token")), packet_prio_low); +@@ -641,6 +640,7 @@ + sstream.imbue(std::locale::classic()); + + while (true) { ++ Object request; + rak::socket_address sa; + int type = '?'; + const Object* transactionId = NULL; +@@ -656,7 +656,6 @@ + total += read; + sstream.str(std::string(buffer, read)); + +- Object request; + sstream >> request; + + // If it's not a valid bencode dictionary at all, it's probably not a DHT +Index: libtorrent/src/dht/dht_transaction.h +=================================================================== +--- libtorrent/src/dht/dht_transaction.h (revision 1063) ++++ libtorrent/src/dht/dht_transaction.h (working copy) +@@ -178,7 +178,7 @@ + // counts announces instead. + const_accessor start_announce(); + +- void receive_peers(const std::string& peers); ++ void receive_peers(const Object& peer_list); + void update_status(); + + private: +Index: libtorrent/src/dht/dht_tracker.cc +=================================================================== +--- libtorrent/src/dht/dht_tracker.cc (revision 1063) ++++ libtorrent/src/dht/dht_tracker.cc (working copy) +@@ -79,7 +79,7 @@ + + // Return compact info (6 bytes) for up to 30 peers, returning different + // peers for each call if there are more. +-std::string ++Object + DhtTracker::get_peers(unsigned int maxPeers) { + PeerList::iterator first = m_peers.begin(); + PeerList::iterator last = m_peers.end(); +@@ -94,7 +94,11 @@ + last = first + maxPeers; + } + +- return std::string(first->c_str(), last->c_str()); ++ Object peers = Object::create_list(); ++ for (; first != last; ++first) ++ peers.insert_back(std::string(first->c_str(), sizeof(*first))); ++ ++ return peers; + } + + // Remove old announces. +Index: libtorrent/src/tracker/tracker_dht.h +=================================================================== +--- libtorrent/src/tracker/tracker_dht.h (revision 1063) ++++ libtorrent/src/tracker/tracker_dht.h (working copy) +@@ -71,7 +71,7 @@ + + bool has_peers() const { return !m_peers.empty(); } + +- void receive_peers(const std::string& peers); ++ void receive_peers(const Object& peer_list); + void receive_success(); + void receive_failed(const char* msg); + void receive_progress(int replied, int contacted); +Index: libtorrent/src/tracker/tracker_dht.cc +=================================================================== +--- libtorrent/src/tracker/tracker_dht.cc (revision 1063) ++++ libtorrent/src/tracker/tracker_dht.cc (working copy) +@@ -114,11 +114,13 @@ + } + + void +-TrackerDht::receive_peers(const std::string& peers) { ++TrackerDht::receive_peers(const Object& peer_list) { + if (!is_busy()) + throw internal_error("TrackerDht::receive_peers called while not busy."); + +- m_peers.parse_address_compact(peers); ++ Object::list_type peers = peer_list.as_list(); ++ for (Object::list_type::const_iterator itr = peers.begin(); itr != peers.end(); ++itr) ++ m_peers.parse_address_compact(itr->as_string()); + } + + void diff --git a/net-libs/libtorrent/libtorrent-0.12.2-r4.ebuild b/net-libs/libtorrent/libtorrent-0.12.2-r4.ebuild new file mode 100644 index 000000000000..be18da686c3b --- /dev/null +++ b/net-libs/libtorrent/libtorrent-0.12.2-r4.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-libs/libtorrent/libtorrent-0.12.2-r4.ebuild,v 1.1 2008/08/26 21:17:15 loki_val Exp $ + +inherit autotools eutils toolchain-funcs flag-o-matic libtool + +DESCRIPTION="LibTorrent is a BitTorrent library written in C++ for *nix." +HOMEPAGE="http://libtorrent.rakshasa.no/" +SRC_URI="http://libtorrent.rakshasa.no/downloads/${P}.tar.gz" +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" + +IUSE="debug ipv6" + +RDEPEND=">=dev-libs/libsigc++-2" +DEPEND="${RDEPEND} + dev-util/pkgconfig" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${PN}-0.11.9+gcc-4.3.patch + epatch "${FILESDIR}"/${P}-dht_bounds_fix.patch + epatch "${FILESDIR}"/${P}-fix_cull.patch + epatch "${FILESDIR}"/${P}-fix_dht_target.patch + epatch "${FILESDIR}"/${P}-fix_have_timer.patch + epatch "${FILESDIR}"/${P}-fix_pex_leak.patch + epatch "${FILESDIR}"/${P}-fix_write_datagram.patch + epatch "${FILESDIR}"/${P}-lt-ver.patch + epatch "${FILESDIR}"/${P}-tracker_timer_fix.patch + epatch "${FILESDIR}"/${P}-fix_dht-get_peers.patch + + elibtoolize #Don't remove + eautoreconf +} + +src_compile() { + replace-flags -Os -O2 + + if [[ $(tc-arch) = "x86" ]]; then + filter-flags -fomit-frame-pointer -fforce-addr + fi + + econf \ + $(use_enable debug) \ + $(use_enable ipv6) \ + --enable-aligned \ + --enable-static \ + --enable-shared \ + --disable-dependency-tracking \ + || die "econf failed" + + emake || die "emake failed" +} + +src_install() { + emake DESTDIR="${D}" install || die "make install failed" + dodoc AUTHORS NEWS README +} |