diff options
author | Peter Alfredsen <loki_val@gentoo.org> | 2008-06-28 11:34:23 +0000 |
---|---|---|
committer | Peter Alfredsen <loki_val@gentoo.org> | 2008-06-28 11:34:23 +0000 |
commit | eb753aa0ab1cbc348dfbd5b491f3e2e29ff9d568 (patch) | |
tree | 4fa5c612344cd3fed3b537f46e7b85773f5f9981 /net-libs | |
parent | Revision bump, fixes bug #229313. Thanks to Thomas Arnett for reporting with ... (diff) | |
download | gentoo-2-eb753aa0ab1cbc348dfbd5b491f3e2e29ff9d568.tar.gz gentoo-2-eb753aa0ab1cbc348dfbd5b491f3e2e29ff9d568.tar.bz2 gentoo-2-eb753aa0ab1cbc348dfbd5b491f3e2e29ff9d568.zip |
Revision bump to update patchset with newest fixes from Josef Drexler. Also fixes bug #227391
(Portage version: 2.2_rc1/cvs/Linux 2.6.25.8 i686)
Diffstat (limited to 'net-libs')
-rw-r--r-- | net-libs/libtorrent/ChangeLog | 12 | ||||
-rw-r--r-- | net-libs/libtorrent/files/libtorrent-0.12.2-fix_have_timer.patch | 47 | ||||
-rw-r--r-- | net-libs/libtorrent/files/libtorrent-0.12.2-fix_pex_leak.patch | 102 | ||||
-rw-r--r-- | net-libs/libtorrent/files/libtorrent-0.12.2-fix_write_datagram.patch | 13 | ||||
-rw-r--r-- | net-libs/libtorrent/libtorrent-0.12.2-r3.ebuild (renamed from net-libs/libtorrent/libtorrent-0.12.2-r2.ebuild) | 7 |
5 files changed, 179 insertions, 2 deletions
diff --git a/net-libs/libtorrent/ChangeLog b/net-libs/libtorrent/ChangeLog index 98a8a439b03d..a08402f24fd1 100644 --- a/net-libs/libtorrent/ChangeLog +++ b/net-libs/libtorrent/ChangeLog @@ -1,6 +1,16 @@ # 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.116 2008/06/05 06:41:55 loki_val Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-libs/libtorrent/ChangeLog,v 1.117 2008/06/28 11:34:22 loki_val Exp $ + +*libtorrent-0.12.2-r3 (28 Jun 2008) + + 28 Jun 2008; Peter Alfredsen <loki_val@gentoo.org> + +files/libtorrent-0.12.2-fix_have_timer.patch, + +files/libtorrent-0.12.2-fix_pex_leak.patch, + +files/libtorrent-0.12.2-fix_write_datagram.patch, + -libtorrent-0.12.2-r2.ebuild, +libtorrent-0.12.2-r3.ebuild: + Revision bump to update patchset with newest fixes from Josef Drexler. + Also fixes bug #227391 *libtorrent-0.12.2-r2 (05 Jun 2008) diff --git a/net-libs/libtorrent/files/libtorrent-0.12.2-fix_have_timer.patch b/net-libs/libtorrent/files/libtorrent-0.12.2-fix_have_timer.patch new file mode 100644 index 000000000000..c42c3f925885 --- /dev/null +++ b/net-libs/libtorrent/files/libtorrent-0.12.2-fix_have_timer.patch @@ -0,0 +1,47 @@ +Index: libtorrent/src/protocol/handshake_manager.cc +=================================================================== +--- libtorrent/src/protocol/handshake_manager.cc (revision 1060) ++++ libtorrent/src/protocol/handshake_manager.cc (working copy) +@@ -208,13 +208,13 @@ + e_none, + &download->info()->hash()); + ++ pcb->peer_chunks()->set_have_timer(handshake->initialized_time()); ++ + if (handshake->unread_size() != 0) { + if (handshake->unread_size() > PeerConnectionBase::ProtocolRead::buffer_size) + throw internal_error("HandshakeManager::receive_succeeded(...) Unread data won't fit PCB's read buffer."); + + pcb->push_unread(handshake->unread_data(), handshake->unread_size()); +- pcb->peer_chunks()->set_have_timer(handshake->initialized_time()); +- + pcb->event_read(); + } + +Index: libtorrent/src/protocol/handshake.cc +=================================================================== +--- libtorrent/src/protocol/handshake.cc (revision 1060) ++++ libtorrent/src/protocol/handshake.cc (working copy) +@@ -86,8 +86,6 @@ + m_uploadThrottle(manager->upload_throttle()->throttle_list()), + m_downloadThrottle(manager->download_throttle()->throttle_list()), + +- m_initializedTime(cachedTime), +- + m_readDone(false), + m_writeDone(false), + +@@ -524,6 +522,13 @@ + if (m_peerInfo->supports_extensions()) + write_extension_handshake(); + ++ // Replay HAVE messages we receive after starting to send the bitfield. ++ // This avoids replaying HAVEs for pieces received between starting the ++ // handshake and now (e.g. when connecting takes longer). Ideally we ++ // should make a snapshot of the bitfield here in case it changes while ++ // we're sending it (if it can't be sent in one write() call). ++ m_initializedTime = cachedTime; ++ + // The download is just starting so we're not sending any + // bitfield. Pretend we wrote it already. + if (m_download->file_list()->bitfield()->is_all_unset() || m_download->initial_seeding() != NULL) { diff --git a/net-libs/libtorrent/files/libtorrent-0.12.2-fix_pex_leak.patch b/net-libs/libtorrent/files/libtorrent-0.12.2-fix_pex_leak.patch new file mode 100644 index 000000000000..91bdc5fdfea9 --- /dev/null +++ b/net-libs/libtorrent/files/libtorrent-0.12.2-fix_pex_leak.patch @@ -0,0 +1,102 @@ +Index: libtorrent/src/net/data_buffer.h +=================================================================== +--- libtorrent/src/net/data_buffer.h (revision 1026) ++++ libtorrent/src/net/data_buffer.h (working copy) +@@ -44,26 +44,28 @@ + + // Recipient must call clear() when done with the buffer. + struct DataBuffer { +- DataBuffer() : m_data(NULL), m_end(NULL), m_copied(false) {} +- DataBuffer(char* data, char* end) : m_data(data), m_end(end), m_copied(false) {} ++ DataBuffer() : m_data(NULL), m_end(NULL), m_owned(true) {} ++ DataBuffer(char* data, char* end) : m_data(data), m_end(end), m_owned(true) {} + ++ DataBuffer clone() const { DataBuffer d = *this; d.m_owned = false; return d; } ++ + char* data() const { return m_data; } + char* end() const { return m_end; } + +- bool copied() const { return m_copied; } ++ bool owned() const { return m_owned; } + bool empty() const { return m_data == NULL; } + size_t length() const { return m_end - m_data; } + + void clear(); +- void set(char* data, char* end, bool copied); ++ void set(char* data, char* end, bool owned); + + private: + char* m_data; + char* m_end; + +- // Used to indicate if buffer held by PCB is copied and needs to be +- // deleted after transmission. +- bool m_copied; ++ // Used to indicate if buffer held by PCB is its own and needs to be ++ // deleted after transmission (false if shared with other connections). ++ bool m_owned; + }; + + inline void +@@ -72,14 +74,14 @@ + delete[] m_data; + + m_data = m_end = NULL; +- m_copied = false; ++ m_owned = false; + } + + inline void +-DataBuffer::set(char* data, char* end, bool copied) { ++DataBuffer::set(char* data, char* end, bool owned) { + m_data = data; + m_end = end; +- m_copied = copied; ++ m_owned = owned; + } + + } +Index: libtorrent/src/protocol/peer_connection_base.cc +=================================================================== +--- libtorrent/src/protocol/peer_connection_base.cc (revision 1026) ++++ libtorrent/src/protocol/peer_connection_base.cc (working copy) +@@ -92,7 +92,7 @@ + if (m_extensions != NULL && !m_extensions->is_default()) + delete m_extensions; + +- if (m_extensionMessage.copied()) ++ if (m_extensionMessage.owned()) + m_extensionMessage.clear(); + } + +@@ -665,7 +665,7 @@ + bool + PeerConnectionBase::up_extension() { + if (m_extensionOffset == extension_must_encrypt) { +- if (m_extensionMessage.copied()) { ++ if (m_extensionMessage.owned()) { + m_encryption.encrypt(m_extensionMessage.data(), m_extensionMessage.length()); + + } else { +@@ -690,7 +690,7 @@ + + // clear() deletes the buffer, only do that if we made a copy, + // otherwise the buffer is shared among all connections. +- if (m_extensionMessage.copied()) ++ if (m_extensionMessage.owned()) + m_extensionMessage.clear(); + else + m_extensionMessage.set(NULL, NULL, false); +Index: libtorrent/src/download/download_main.h +=================================================================== +--- libtorrent/src/download/download_main.h (revision 1026) ++++ libtorrent/src/download/download_main.h (working copy) +@@ -105,7 +105,7 @@ + ThrottleList* download_throttle() { return m_downloadThrottle; } + void set_download_throttle(ThrottleList* t) { m_downloadThrottle = t; } + +- DataBuffer get_ut_pex(bool initial) { return initial ? m_ut_pex_initial : m_ut_pex_delta; } ++ DataBuffer get_ut_pex(bool initial) { return (initial ? m_ut_pex_initial : m_ut_pex_delta).clone(); } + + bool want_pex_msg() { return m_info->is_pex_active() && m_peerList.available_list()->want_more(); }; + diff --git a/net-libs/libtorrent/files/libtorrent-0.12.2-fix_write_datagram.patch b/net-libs/libtorrent/files/libtorrent-0.12.2-fix_write_datagram.patch new file mode 100644 index 000000000000..f89cd0f26d39 --- /dev/null +++ b/net-libs/libtorrent/files/libtorrent-0.12.2-fix_write_datagram.patch @@ -0,0 +1,13 @@ +Index: libtorrent/src/net/socket_datagram.cc +=================================================================== +--- libtorrent/src/net/socket_datagram.cc (revision 1060) ++++ libtorrent/src/net/socket_datagram.cc (working copy) +@@ -73,7 +73,7 @@ + int r; + + if (sa != NULL) { +- r = ::sendto(m_fileDesc, buffer, length, 0, sa->c_sockaddr(), sizeof(rak::socket_address)); ++ r = ::sendto(m_fileDesc, buffer, length, 0, sa->sa_inet()->c_sockaddr(), sizeof(rak::socket_address_inet)); + } else { + r = ::send(m_fileDesc, buffer, length, 0); + } diff --git a/net-libs/libtorrent/libtorrent-0.12.2-r2.ebuild b/net-libs/libtorrent/libtorrent-0.12.2-r3.ebuild index f6193d03f5d2..f5dbd6a76d37 100644 --- a/net-libs/libtorrent/libtorrent-0.12.2-r2.ebuild +++ b/net-libs/libtorrent/libtorrent-0.12.2-r3.ebuild @@ -1,6 +1,6 @@ # 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-r2.ebuild,v 1.1 2008/06/05 06:41:55 loki_val Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-libs/libtorrent/libtorrent-0.12.2-r3.ebuild,v 1.1 2008/06/28 11:34:22 loki_val Exp $ inherit autotools eutils toolchain-funcs flag-o-matic libtool @@ -24,8 +24,12 @@ src_unpack() { 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 + elibtoolize #Don't remove eautoreconf } @@ -40,6 +44,7 @@ src_compile() { econf \ $(use_enable debug) \ $(use_enable ipv6) \ + --enable-aligned \ --enable-static \ --enable-shared \ --disable-dependency-tracking \ |