On Thu, 12 Jul 2012, Daniel Bolgheroni wrote:

> On Fri, Jun 15, 2012 at 11:21:06AM +0200, David Coppa wrote:
> > 
> > Can you check if the old 0.12.9/0.8.9 exposes the same symptoms on
> > recent -current?
> 
> Sorry, but really missed this.
> 
> > I'm thinking about backing out the update to 0.13.2/0.9.2...
> 
> This solves the problem for amd64.
> Thank you.

This new release is an epic fail, I don't want to ship it with 5.2.

Apart from the huge ipi storms that lead to system freezes, it also
segfaults with strict malloc flags :(

Latest fix to src/sys/kern/kern_synch.c from haesbaert@ does not
help here...

On the contrary 0.8.9/0.12.9 is much more stable, with ipi rarely
over 100 and has no problems with malloc J flag or S.

So, here's my rollback diff. Updating from 0.13.2/0.9.2 with
'pkg_add -ui' works fine (I've added EPOCH).

I'd like to commit it, if nobody has objections.

cheers!
David

Index: libtorrent/Makefile
===================================================================
RCS file: /cvs/ports/net/libtorrent/Makefile,v
retrieving revision 1.31
diff -u -p -r1.31 Makefile
--- libtorrent/Makefile 11 Jul 2012 08:33:39 -0000      1.31
+++ libtorrent/Makefile 13 Jul 2012 12:01:43 -0000
@@ -2,9 +2,9 @@
 
 COMMENT=               BitTorrent library written in C++
 
-DISTNAME=              libtorrent-0.13.2
-REVISION=              0
-SHARED_LIBS +=         torrent 19.0    # .14.4
+DISTNAME=              libtorrent-0.12.9
+EPOCH=                 0
+SHARED_LIBS +=         torrent 20.0    # .14.1
 CATEGORIES=            net devel
 
 HOMEPAGE=              http://libtorrent.rakshasa.no/
Index: libtorrent/distinfo
===================================================================
RCS file: /cvs/ports/net/libtorrent/distinfo,v
retrieving revision 1.17
diff -u -p -r1.17 distinfo
--- libtorrent/distinfo 2 May 2012 14:06:03 -0000       1.17
+++ libtorrent/distinfo 13 Jul 2012 12:01:43 -0000
@@ -1,5 +1,5 @@
-MD5 (libtorrent-0.13.2.tar.gz) = lsC4FQE1ffQCq1kvWeyuqw==
-RMD160 (libtorrent-0.13.2.tar.gz) = CQ5q+bQximF2BkFZ9qj3CrcIx/4=
-SHA1 (libtorrent-0.13.2.tar.gz) = TzSnRPvhDFSq9T00aB+rwaSdclc=
-SHA256 (libtorrent-0.13.2.tar.gz) = 
7S8t6hbCnKxj+ick9mWHhtlV+XWGH6aBG88Vl/+KXk8=
-SIZE (libtorrent-0.13.2.tar.gz) = 725088
+MD5 (libtorrent-0.12.9.tar.gz) = sSi70yTwPrQu9QYAgPh1SA==
+RMD160 (libtorrent-0.12.9.tar.gz) = qJjogtqUl3lz1i80pd2CV3/YPPU=
+SHA1 (libtorrent-0.12.9.tar.gz) = F2qDbG5oXk2tcawIwOCcqqW3dXw=
+SHA256 (libtorrent-0.12.9.tar.gz) = 
FdyejdRdBw9Eflmb7wjvDKQhusbn9V5gjc0ZNgWUr2Q=
+SIZE (libtorrent-0.12.9.tar.gz) = 667864
Index: libtorrent/patches/patch-scripts_checks_m4
===================================================================
RCS file: /cvs/ports/net/libtorrent/patches/patch-scripts_checks_m4,v
retrieving revision 1.3
diff -u -p -r1.3 patch-scripts_checks_m4
--- libtorrent/patches/patch-scripts_checks_m4  2 May 2012 14:06:03 -0000       
1.3
+++ libtorrent/patches/patch-scripts_checks_m4  13 Jul 2012 12:01:43 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-scripts_checks_m4,v 1.3 2012/05/02 14:06:03 dcoppa Exp $
---- scripts/checks.m4.orig     Thu Mar 29 15:02:59 2012
-+++ scripts/checks.m4  Thu Apr 12 12:39:26 2012
+--- scripts/checks.m4.orig     Fri Apr  6 15:17:41 2012
++++ scripts/checks.m4  Fri Apr  6 15:19:11 2012
 @@ -93,51 +93,12 @@ AC_DEFUN([TORRENT_CHECK_KQUEUE], [
      ])
  ])
@@ -8,8 +8,8 @@ $OpenBSD: patch-scripts_checks_m4,v 1.3 
 -AC_DEFUN([TORRENT_CHECK_KQUEUE_SOCKET_ONLY], [
 -  AC_MSG_CHECKING(whether kqueue supports pipes and ptys)
 -
--  AC_RUN_IFELSE([AC_LANG_SOURCE([
--      #include <fcntl.h>
+-  AC_RUN_IFELSE(
+-    [[#include <fcntl.h>
 -      #include <stdlib.h>
 -      #include <unistd.h>
 -      #include <sys/event.h>
@@ -34,7 +34,7 @@ $OpenBSD: patch-scripts_checks_m4,v 1.3 
 -        if ((n = kevent(kfd, NULL, 0, ev_out, 2, &ts)) < 1) return 9;
 -        return 0;
 -      }
--      ])],
+-    ]],
 -    [
 -      AC_MSG_RESULT(yes)
 -    ], [
@@ -53,15 +53,3 @@ $OpenBSD: patch-scripts_checks_m4,v 1.3 
          fi
      ])
  ])
-@@ -149,11 +110,9 @@ AC_DEFUN([TORRENT_WITHOUT_KQUEUE], [
-     [
-       if test "$withval" = "yes"; then
-         TORRENT_CHECK_KQUEUE
--        TORRENT_CHECK_KQUEUE_SOCKET_ONLY
-       fi
-     ], [
-         TORRENT_CHECK_KQUEUE
--        TORRENT_CHECK_KQUEUE_SOCKET_ONLY
-     ])
- ])
- 
Index: libtorrent/patches/patch-src_download_download_constructor_cc
===================================================================
RCS file: libtorrent/patches/patch-src_download_download_constructor_cc
diff -N libtorrent/patches/patch-src_download_download_constructor_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libtorrent/patches/patch-src_download_download_constructor_cc       13 Jul 
2012 12:01:43 -0000
@@ -0,0 +1,34 @@
+$OpenBSD$
+
+Fix: libtorrent rejects a torrent which has a valid announce but a
+malformed announce-list (http://libtorrent.rakshasa.no/ticket/2505)
+
+Spelling fixes
+
+--- src/download/download_constructor.cc.orig  Tue Jun  7 12:52:57 2011
++++ src/download/download_constructor.cc       Fri Jul 13 12:46:49 2012
+@@ -98,6 +98,15 @@ DownloadConstructor::initialize(Object& b) {
+   parse_name(b.get_key("info"));
+   parse_info(b.get_key("info"));
+ 
++  if (b.has_key_list("announce-list"))
++    if (b.get_key_list("announce-list").empty()) {
++      b.erase_key("announce-list");
++    } else {
++      Object::list_type & l = b.get_key_list("announce-list");
++      if (l.size() == 1 && !l.begin()->is_list()) {
++        b.erase_key("announce-list");  
++      }
++    }
+   parse_tracker(b);
+ }
+ 
+@@ -344,7 +353,7 @@ DownloadConstructor::create_path(const Object::list_ty
+     throw input_error("Bad torrent file, \"path\" has zero entries.");
+ 
+   if (std::find_if(plist.begin(), plist.end(), 
std::ptr_fun(&DownloadConstructor::is_invalid_path_element)) != plist.end())
+-    throw input_error("Bad torrent file, \"path\" has zero entries or a zero 
lenght entry.");
++    throw input_error("Bad torrent file, \"path\" has zero entries or a zero 
length entry.");
+ 
+   Path p;
+   p.set_encoding(enc);
Index: libtorrent/patches/patch-src_protocol_handshake_cc
===================================================================
RCS file: libtorrent/patches/patch-src_protocol_handshake_cc
diff -N libtorrent/patches/patch-src_protocol_handshake_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libtorrent/patches/patch-src_protocol_handshake_cc  13 Jul 2012 12:01:43 
-0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Missing include
+(upstream git commit 269843c73206fde90e17cc02aa665ebe0e319f63)
+
+--- src/protocol/handshake.cc.orig     Thu Oct 20 16:16:31 2011
++++ src/protocol/handshake.cc  Thu Oct 20 16:16:53 2011
+@@ -36,6 +36,8 @@
+ 
+ #include "config.h"
+ 
++#include <stdio.h>
++
+ #include "download/download_main.h"
+ #include "net/throttle_list.h"
+ #include "torrent/dht_manager.h"
Index: libtorrent/patches/patch-src_protocol_peer_connection_base_cc
===================================================================
RCS file: libtorrent/patches/patch-src_protocol_peer_connection_base_cc
diff -N libtorrent/patches/patch-src_protocol_peer_connection_base_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libtorrent/patches/patch-src_protocol_peer_connection_base_cc       13 Jul 
2012 12:01:43 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Spelling fixes
+
+--- src/protocol/peer_connection_base.cc.orig  Sun Apr 24 12:47:30 2011
++++ src/protocol/peer_connection_base.cc       Thu Oct 20 10:19:35 2011
+@@ -562,7 +562,7 @@ PeerConnectionBase::down_chunk_skip_process(const void
+   }
+ 
+   if (!transfer->block()->is_transfering())
+-    throw internal_error("PeerConnectionBase::down_chunk_skip_process(...) 
block is not transfering, yet we have non-leaders.");
++    throw internal_error("PeerConnectionBase::down_chunk_skip_process(...) 
block is not transferring, yet we have non-leaders.");
+ 
+   // Temporary test.
+   if (transfer->position() > transfer->block()->leader()->position())
Index: libtorrent/patches/patch-src_torrent_poll_kqueue_cc
===================================================================
RCS file: /cvs/ports/net/libtorrent/patches/patch-src_torrent_poll_kqueue_cc,v
retrieving revision 1.5
diff -u -p -r1.5 patch-src_torrent_poll_kqueue_cc
--- libtorrent/patches/patch-src_torrent_poll_kqueue_cc 11 Jul 2012 08:33:39 
-0000      1.5
+++ libtorrent/patches/patch-src_torrent_poll_kqueue_cc 13 Jul 2012 12:01:43 
-0000
@@ -9,8 +9,8 @@ this will cause a segfault.
 Limit the number of events to the number of fds with an upper limit of
 maxEvents.
 
---- src/torrent/poll_kqueue.cc.orig    Wed Feb 15 05:14:30 2012
-+++ src/torrent/poll_kqueue.cc Wed Jul 11 09:33:45 2012
+--- src/torrent/poll_kqueue.cc.orig    Tue Apr  5 12:25:53 2011
++++ src/torrent/poll_kqueue.cc Fri Jul 13 10:59:11 2012
 @@ -37,6 +37,7 @@
  #include "config.h"
  
@@ -19,7 +19,7 @@ maxEvents.
  
  #include <algorithm>
  #include <unistd.h>
-@@ -120,12 +121,12 @@ PollKQueue::create(int maxOpenSockets) {
+@@ -111,12 +112,12 @@ PollKQueue::create(int maxOpenSockets) {
    if (fd == -1)
      return NULL;
  
Index: libtorrent/patches/patch-src_torrent_tracker_controller_cc
===================================================================
RCS file: libtorrent/patches/patch-src_torrent_tracker_controller_cc
diff -N libtorrent/patches/patch-src_torrent_tracker_controller_cc
--- libtorrent/patches/patch-src_torrent_tracker_controller_cc  11 Jul 2012 
08:33:39 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-$OpenBSD: patch-src_torrent_tracker_controller_cc,v 1.1 2012/07/11 08:33:39 
dcoppa Exp $
-
-Fix a bug where manual tracker update for a preferred tracker that
-fails would end up rerequesting instantly
-(upstream git commit 78f56ee74cecd8e82d39baaea10395301fbec4b8)
-
---- src/torrent/tracker_controller.cc.orig     Tue Apr 10 14:46:33 2012
-+++ src/torrent/tracker_controller.cc  Tue Jul 10 16:33:20 2012
-@@ -485,20 +485,12 @@ TrackerController::do_timeout() {
-     if (itr == m_tracker_list->end())
-       return;
- 
--    if ((m_flags & flag_send_update)) {
--      // TODO: Also watch out for failed trackers requiring timeouts.
--      m_tracker_list->send_state_itr(itr, send_state);
-+    int32_t next_timeout = (*itr)->activity_time_next();
- 
--    } else {
--      TrackerList::iterator itr = 
m_tracker_list->find_next_to_request(m_tracker_list->begin());
--
--      int32_t next_timeout = (*itr)->activity_time_next();
--
--      if (next_timeout <= cachedTime.seconds())
--        m_tracker_list->send_state_itr(itr, send_state);
--      else
--        update_timeout(next_timeout - cachedTime.seconds());
--    }
-+    if (next_timeout <= cachedTime.seconds())
-+      m_tracker_list->send_state_itr(itr, send_state);
-+    else
-+      update_timeout(next_timeout - cachedTime.seconds());
-   }
- 
-   if (m_slot_timeout)
Index: libtorrent/patches/patch-test_Makefile_in
===================================================================
RCS file: /cvs/ports/net/libtorrent/patches/patch-test_Makefile_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-test_Makefile_in
--- libtorrent/patches/patch-test_Makefile_in   2 May 2012 14:06:03 -0000       
1.2
+++ libtorrent/patches/patch-test_Makefile_in   13 Jul 2012 12:01:43 -0000
@@ -2,9 +2,9 @@ $OpenBSD: patch-test_Makefile_in,v 1.2 2
 
 Unbreak build
 
---- test/Makefile.in.orig      Fri Apr 20 08:56:15 2012
-+++ test/Makefile.in   Mon Apr 23 13:42:26 2012
-@@ -326,7 +326,7 @@ LibTorrentTest_SOURCES = \
+--- test/Makefile.in.orig      Thu Oct 20 10:49:26 2011
++++ test/Makefile.in   Thu Oct 20 10:49:36 2011
+@@ -251,7 +251,7 @@ LibTorrentTest_SOURCES = \
        main.cc
  
  LibTorrentTest_CXXFLAGS = $(CPPUNIT_CFLAGS)
Index: libtorrent/patches/patch-test_rak_allocators_test_cc
===================================================================
RCS file: libtorrent/patches/patch-test_rak_allocators_test_cc
diff -N libtorrent/patches/patch-test_rak_allocators_test_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libtorrent/patches/patch-test_rak_allocators_test_cc        13 Jul 2012 
12:01:43 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+
+Unbreak build
+(upstream git commit 269843c73206fde90e17cc02aa665ebe0e319f63)
+
+--- test/rak/allocators_test.cc.orig   Tue Apr  5 12:25:58 2011
++++ test/rak/allocators_test.cc        Thu Oct 20 10:38:52 2011
+@@ -1,12 +1,14 @@
+ #include "config.h"
+ 
+-#import "allocators_test.h"
++#include <stdint.h>
+ 
++#include "allocators_test.h"
++
+ CPPUNIT_TEST_SUITE_REGISTRATION(AllocatorsTest);
+ 
+ template <typename T>
+ bool is_aligned(const T& t) {
+-  return t.empty() || (reinterpret_cast<int>(&t[0]) & (LT_SMP_CACHE_BYTES - 
1)) == 0x0;
++  return t.empty() || (reinterpret_cast<intptr_t>(&t[0]) & 
(LT_SMP_CACHE_BYTES - 1)) == 0x0;
+ }
+ 
+ void
Index: libtorrent/patches/patch-test_torrent_tracker_controller_test_cc
===================================================================
RCS file: libtorrent/patches/patch-test_torrent_tracker_controller_test_cc
diff -N libtorrent/patches/patch-test_torrent_tracker_controller_test_cc
--- libtorrent/patches/patch-test_torrent_tracker_controller_test_cc    11 Jul 
2012 08:33:39 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,28 +0,0 @@
-$OpenBSD: patch-test_torrent_tracker_controller_test_cc,v 1.1 2012/07/11 
08:33:39 dcoppa Exp $
-
-Fix a bug where manual tracker update for a preferred tracker that
-fails would end up rerequesting instantly (test)
-(upstream git commit 78f56ee74cecd8e82d39baaea10395301fbec4b8)
-
---- test/torrent/tracker_controller_test.cc.orig       Tue Apr 10 14:46:33 2012
-+++ test/torrent/tracker_controller_test.cc    Tue Jul 10 16:33:20 2012
-@@ -237,6 +237,19 @@ tracker_controller_test::test_send_update_normal() {
- }
- 
- void
-+tracker_controller_test::test_send_update_failure() {
-+  torrent::cachedTime = rak::timer::from_seconds(1 << 20);
-+  TEST_SINGLE_BEGIN();
-+
-+  tracker_controller.send_update_event();
-+
-+  TEST_SINGLE_FAILURE_TIMEOUT(5);
-+  TEST_SINGLE_FAILURE_TIMEOUT(10);
-+
-+  TEST_SINGLE_END(0, 2);
-+}
-+
-+void
- tracker_controller_test::test_send_task_timeout() {
-   TEST_SINGLE_BEGIN();
-   TEST_SEND_SINGLE_BEGIN(update);
Index: libtorrent/patches/patch-test_torrent_tracker_controller_test_h
===================================================================
RCS file: libtorrent/patches/patch-test_torrent_tracker_controller_test_h
diff -N libtorrent/patches/patch-test_torrent_tracker_controller_test_h
--- libtorrent/patches/patch-test_torrent_tracker_controller_test_h     11 Jul 
2012 08:33:39 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-test_torrent_tracker_controller_test_h,v 1.1 2012/07/11 
08:33:39 dcoppa Exp $
-
-Fix a bug where manual tracker update for a preferred tracker that
-fails would end up rerequesting instantly (test)
-(upstream git commit 78f56ee74cecd8e82d39baaea10395301fbec4b8)
-
---- test/torrent/tracker_controller_test.h.orig        Tue Apr 10 14:46:33 2012
-+++ test/torrent/tracker_controller_test.h     Tue Jul 10 16:33:20 2012
-@@ -18,6 +18,7 @@ class tracker_controller_test : public CppUnit::TestFi
-   CPPUNIT_TEST(test_send_stop_normal);
-   CPPUNIT_TEST(test_send_completed_normal);
-   CPPUNIT_TEST(test_send_update_normal);
-+  CPPUNIT_TEST(test_send_update_failure);
-   CPPUNIT_TEST(test_send_task_timeout);
-   CPPUNIT_TEST(test_send_close_on_enable);
- 
-@@ -51,6 +52,7 @@ class tracker_controller_test : public CppUnit::TestFi
-   void test_send_stop_normal();
-   void test_send_completed_normal();
-   void test_send_update_normal();
-+  void test_send_update_failure();
-   void test_send_task_timeout();
-   void test_send_close_on_enable();
- 
Index: libtorrent/pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/libtorrent/pkg/PLIST,v
retrieving revision 1.10
diff -u -p -r1.10 PLIST
--- libtorrent/pkg/PLIST        2 May 2012 14:06:03 -0000       1.10
+++ libtorrent/pkg/PLIST        13 Jul 2012 12:01:43 -0000
@@ -10,7 +10,6 @@ include/torrent/data/block.h
 include/torrent/data/block_list.h
 include/torrent/data/block_transfer.h
 include/torrent/data/chunk_utils.h
-include/torrent/data/download_data.h
 include/torrent/data/file.h
 include/torrent/data/file_list.h
 include/torrent/data/file_list_iterator.h
@@ -24,7 +23,6 @@ include/torrent/download.h
 include/torrent/download/choke_group.h
 include/torrent/download/choke_queue.h
 include/torrent/download/download_manager.h
-include/torrent/download/group_entry.h
 include/torrent/download/resource_manager.h
 include/torrent/download_info.h
 include/torrent/error.h
@@ -50,21 +48,16 @@ include/torrent/poll_epoll.h
 include/torrent/poll_kqueue.h
 include/torrent/poll_select.h
 include/torrent/rate.h
+include/torrent/thread_base.h
 include/torrent/throttle.h
 include/torrent/torrent.h
 include/torrent/tracker.h
-include/torrent/tracker_controller.h
 include/torrent/tracker_list.h
 include/torrent/utils/
 include/torrent/utils/extents.h
-include/torrent/utils/log.h
-include/torrent/utils/log_buffer.h
 include/torrent/utils/log_files.h
 include/torrent/utils/option_strings.h
-include/torrent/utils/ranges.h
 include/torrent/utils/resume.h
-include/torrent/utils/signal_bitfield.h
-include/torrent/utils/thread_base.h
 lib/libtorrent.a
 lib/libtorrent.la
 lib/pkgconfig/
Index: rtorrent/Makefile
===================================================================
RCS file: /cvs/ports/net/rtorrent/Makefile,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile
--- rtorrent/Makefile   2 May 2012 14:06:31 -0000       1.34
+++ rtorrent/Makefile   13 Jul 2012 12:01:48 -0000
@@ -2,7 +2,8 @@
 
 COMMENT=               ncurses BitTorrent client based on libTorrent
 
-DISTNAME=              rtorrent-0.9.2
+DISTNAME=              rtorrent-0.8.9
+EPOCH=                 0
 CATEGORIES=            net
 
 HOMEPAGE=              http://libtorrent.rakshasa.no/
@@ -17,7 +18,7 @@ PERMIT_DISTFILES_FTP= Yes
 
 WANTLIB=               c crypto curl>=14 idn m ncursesw \
                        pthread sigc-2.0 ssl stdc++ \
-                       torrent>=19 z
+                       torrent>=20 z
 
 MASTER_SITES=          ${HOMEPAGE}downloads/
 
@@ -30,7 +31,7 @@ MODGCC4_LANGS=                c++
 MODGCC4_VERSION=       4.6
 
 BUILD_DEPENDS=         devel/cppunit
-LIB_DEPENDS=           net/libtorrent>=0.13.2 \
+LIB_DEPENDS=           net/libtorrent>=0.12.9 \
                        net/curl
 
 USE_LIBTOOL=           Yes
Index: rtorrent/distinfo
===================================================================
RCS file: /cvs/ports/net/rtorrent/distinfo,v
retrieving revision 1.17
diff -u -p -r1.17 distinfo
--- rtorrent/distinfo   2 May 2012 14:06:31 -0000       1.17
+++ rtorrent/distinfo   13 Jul 2012 12:01:48 -0000
@@ -1,5 +1,5 @@
-MD5 (rtorrent-0.9.2.tar.gz) = csPpq4Wb2nzIqpbAtQiwnw==
-RMD160 (rtorrent-0.9.2.tar.gz) = EwpMfzvQGPckfUVhFw1oeKt6Eg8=
-SHA1 (rtorrent-0.9.2.tar.gz) = KmQtcidFCRJlA37YkpojwjejuZ8=
-SHA256 (rtorrent-0.9.2.tar.gz) = XI+MeAvuN2r848HN4vXsuSj0C6wjsrgXHe7VzzyIjD0=
-SIZE (rtorrent-0.9.2.tar.gz) = 591837
+MD5 (rtorrent-0.8.9.tar.gz) = YpJHY2yxIQZjtS2tvQQKbA==
+RMD160 (rtorrent-0.8.9.tar.gz) = 156s9tY9E1FMB8HDWmYv6l81rvE=
+SHA1 (rtorrent-0.8.9.tar.gz) = CsUcGF6YtaOG5fGge8qamWPi1s4=
+SHA256 (rtorrent-0.8.9.tar.gz) = zKcOs2oMF2u9b9s6/ivJ8WP6TJN3/DO8KWid7GDPbYQ=
+SIZE (rtorrent-0.8.9.tar.gz) = 570904
Index: rtorrent/patches/patch-src_command_network_cc
===================================================================
RCS file: rtorrent/patches/patch-src_command_network_cc
diff -N rtorrent/patches/patch-src_command_network_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ rtorrent/patches/patch-src_command_network_cc       13 Jul 2012 12:01:48 
-0000
@@ -0,0 +1,35 @@
+$OpenBSD$
+
+Unlink the target filename of 'network.scgi.open_local' before
+opening (upstream git commit 5f21e207c3ead9373d1374e36fb78fb9741b32af)
+
+--- src/command_network.cc.orig        Tue Jun 21 08:46:48 2011
++++ src/command_network.cc     Thu Oct 20 12:33:04 2011
+@@ -39,6 +39,7 @@
+ #include <functional>
+ #include <fstream>
+ #include <cstdio>
++#include <unistd.h>
+ #include <rak/address_info.h>
+ #include <rak/path.h>
+ #include <torrent/connection_manager.h>
+@@ -350,6 +351,7 @@ apply_scgi(const std::string& arg, int type) {
+     int port, err;
+     char dummy;
+     char address[1024];
++    std::string path;
+ 
+     switch (type) {
+     case 1:
+@@ -381,7 +383,10 @@ apply_scgi(const std::string& arg, int type) {
+ 
+     case 2:
+     default:
+-      scgi->open_named(rak::path_expand(arg));
++      path = rak::path_expand(arg);
++
++      unlink(path.c_str());
++      scgi->open_named(path);
+       break;
+     }
+ 
Index: rtorrent/patches/patch-src_command_scheduler_cc
===================================================================
RCS file: rtorrent/patches/patch-src_command_scheduler_cc
diff -N rtorrent/patches/patch-src_command_scheduler_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ rtorrent/patches/patch-src_command_scheduler_cc     13 Jul 2012 12:01:48 
-0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/command_scheduler.cc.orig      Fri Jul 13 13:48:30 2012
++++ src/command_scheduler.cc   Fri Jul 13 13:48:44 2012
+@@ -66,7 +66,7 @@ cmd_scheduler_simple_removed(core::Download* download)
+   core::View* viewActive = *control->view_manager()->find("active");
+   int64_t maxActive = rpc::call_command("scheduler.max_active", 
torrent::Object()).as_value();
+ 
+-  if (viewActive->size_visible() >= maxActive)
++  if ((int64_t)viewActive->size_visible() >= maxActive)
+     return torrent::Object();
+ 
+   // The 'started' view contains all the views we may choose amongst.
Index: rtorrent/patches/patch-src_display_window_file_list_cc
===================================================================
RCS file: rtorrent/patches/patch-src_display_window_file_list_cc
diff -N rtorrent/patches/patch-src_display_window_file_list_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ rtorrent/patches/patch-src_display_window_file_list_cc      13 Jul 2012 
12:01:48 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/display/window_file_list.cc.orig       Fri Jul 13 13:35:22 2012
++++ src/display/window_file_list.cc    Fri Jul 13 13:35:41 2012
+@@ -123,7 +123,7 @@ WindowFileList::redraw() {
+   if (fl->size_files() == 0 || m_canvas->height() < 2)
+     return;
+ 
+-  iterator entries[m_canvas->height() - 1];
++  std::vector<iterator> entries(m_canvas->height() - 1);
+ 
+   unsigned int last = 0;
+ 
Index: rtorrent/patches/patch-src_rpc_scgi_cc
===================================================================
RCS file: rtorrent/patches/patch-src_rpc_scgi_cc
diff -N rtorrent/patches/patch-src_rpc_scgi_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ rtorrent/patches/patch-src_rpc_scgi_cc      13 Jul 2012 12:01:48 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+SCGI m_task queue could overflow since the check was not working
+(upstream git commit f5d4924b22f7ebbfef111668405987a1b893a412)
+
+--- src/rpc/scgi.cc.orig       Tue Apr  5 12:26:10 2011
++++ src/rpc/scgi.cc    Thu Oct 20 12:32:42 2011
+@@ -139,7 +139,7 @@ SCgi::event_read() {
+   while ((fd = get_fd().accept(&sa)).is_valid()) {
+     SCgiTask* task = std::find_if(m_task, m_task + max_tasks, 
std::mem_fun_ref(&SCgiTask::is_available));
+ 
+-    if (task == task + max_tasks) {
++    if (task == m_task + max_tasks) {
+       // Ergh... just closing for now.
+       fd.close();
+       continue;
Index: rtorrent/patches/patch-src_thread_base_cc
===================================================================
RCS file: rtorrent/patches/patch-src_thread_base_cc
diff -N rtorrent/patches/patch-src_thread_base_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ rtorrent/patches/patch-src_thread_base_cc   13 Jul 2012 12:01:48 -0000
@@ -0,0 +1,44 @@
+$OpenBSD$
+
+Fix an issue causing high loads while waiting for main thread to
+exit polling (upstream git commit ce166217075e2368e8ad19ef91737fad2e3f918f)
+
+--- src/thread_base.cc.orig    Tue Apr  5 12:26:11 2011
++++ src/thread_base.cc Fri Jul 13 12:21:05 2012
+@@ -43,6 +43,7 @@
+ #include <cstring>
+ #include <iostream>
+ #include <signal.h>
++#include <unistd.h>
+ #include <rak/error_number.h>
+ #include <torrent/exceptions.h>
+ 
+@@ -61,7 +62,7 @@ class lt_cacheline_aligned thread_queue_hack { (public
+ 
+   static const unsigned int max_size = 32;
+ 
+-  thread_queue_hack() { std::memset(this, 0, sizeof(thread_queue_hack)); }
++  thread_queue_hack() : m_lock(0) { std::memset(this, 0, 
sizeof(thread_queue_hack)); }
+ 
+   void     lock()   { while (!__sync_bool_compare_and_swap(&m_lock, 0, 1)) 
usleep(0); }
+   void     unlock() { __sync_bool_compare_and_swap(&m_lock, 1, 0); }
+@@ -201,10 +202,15 @@ ThreadBase::queue_item(thread_base_func newFunc) {
+ 
+ void
+ ThreadBase::interrupt_main_polling() {
+-  do {
++  int sleep_length = 0;
++
++  while (ThreadBase::is_main_polling()) {
++    pthread_kill(main_thread->m_thread, SIGUSR1);
++
+     if (!ThreadBase::is_main_polling())
+       return;
+-    
+-    pthread_kill(main_thread->m_thread, SIGUSR1);
+-  } while (1);
++
++    usleep(sleep_length);
++    sleep_length = std::min(sleep_length + 50, 1000);
++  }
+ }
Index: rtorrent/patches/patch-src_ui_element_file_list_cc
===================================================================
RCS file: rtorrent/patches/patch-src_ui_element_file_list_cc
diff -N rtorrent/patches/patch-src_ui_element_file_list_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ rtorrent/patches/patch-src_ui_element_file_list_cc  13 Jul 2012 12:01:48 
-0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+Fix segfault (upstream git commit 80c97c398b871c3e9421fde4f276bee4fd23a164)
+
+--- src/ui/element_file_list.cc.orig   Sat May 21 15:49:37 2011
++++ src/ui/element_file_list.cc        Thu Oct 20 12:32:58 2011
+@@ -251,7 +251,10 @@ ElementFileList::receive_select() {
+     return;
+ 
+   if (is_collapsed() && !m_selected.is_file()) {
++    torrent::FileList* fl = m_download->download()->file_list();
+     m_selected++;
++    if (m_selected == iterator(fl->end()))
++      m_selected = iterator(fl->begin());
+     m_window->mark_dirty();
+   } else {
+     activate_display(DISPLAY_INFO);
Index: rtorrent/patches/patch-test_Makefile_in
===================================================================
RCS file: /cvs/ports/net/rtorrent/patches/patch-test_Makefile_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-test_Makefile_in
--- rtorrent/patches/patch-test_Makefile_in     2 May 2012 14:06:31 -0000       
1.2
+++ rtorrent/patches/patch-test_Makefile_in     13 Jul 2012 12:01:48 -0000
@@ -2,9 +2,25 @@ $OpenBSD: patch-test_Makefile_in,v 1.2 2
 
 Unbreak build
 
---- test/Makefile.in.orig      Thu Apr 12 13:25:17 2012
-+++ test/Makefile.in   Thu Apr 12 13:25:30 2012
-@@ -257,7 +257,7 @@ rtorrentTest_SOURCES = \
+--- test/Makefile.in.orig      Tue Jun 21 09:11:22 2011
++++ test/Makefile.in   Thu Oct 20 15:50:36 2011
+@@ -228,13 +228,13 @@ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ rtorrentTest_LDADD = \
++      ../src/libsub_root.a \
+       ../src/ui/libsub_ui.a \
+       ../src/core/libsub_core.a \
+       ../src/display/libsub_display.a \
+       ../src/input/libsub_input.a \
+       ../src/rpc/libsub_rpc.a \
+-      ../src/utils/libsub_utils.a \
+-      ../src/libsub_root.a
++      ../src/utils/libsub_utils.a
+ 
+ rtorrentTest_SOURCES = \
+       rpc/command_test.cc \
+@@ -250,7 +250,7 @@ rtorrentTest_SOURCES = \
        main.cc
  
  rtorrentTest_CXXFLAGS = $(CPPUNIT_CFLAGS)

Reply via email to