View | Details | Raw Unified | Return to bug 229553
Collapse All | Expand All

(-)net-p2p/libtorrent/Makefile (-14 / +6 lines)
Lines 1-8 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	libtorrent
3
PORTNAME=	libtorrent
4
PORTVERSION=	0.13.6
4
PORTVERSION=	0.13.7
5
PORTREVISION=	5
6
CATEGORIES=	net-p2p
5
CATEGORIES=	net-p2p
7
MASTER_SITES=	http://rtorrent.net/downloads/
6
MASTER_SITES=	http://rtorrent.net/downloads/
8
7
Lines 14-30 Link Here
14
13
15
BROKEN_SSL=	openssl-devel
14
BROKEN_SSL=	openssl-devel
16
15
17
CONFLICTS_INSTALL=	rblibtorrent-[0-9]* rblibtorrent-devel-[0-9]*
16
USES=		autoreconf:build compiler:c++11-lang libtool pathfix pkgconfig ssl
18
19
USES=		compiler:c++11-lang libtool pathfix pkgconfig ssl
20
GNU_CONFIGURE=	yes
17
GNU_CONFIGURE=	yes
21
CONFIGURE_ARGS=	--disable-debug
18
CONFIGURE_ARGS=	--disable-debug
22
CONFIGURE_ENV=	OPENSSL_LIBS="-L${OPENSSLLIB} -lcrypto" OPENSSL_CFLAGS="-I\
19
CONFIGURE_ENV=	OPENSSL_LIBS="-L${OPENSSLLIB} -lcrypto" OPENSSL_CFLAGS="-I\
23
								${OPENSSLINC}"
20
								${OPENSSLINC}"
24
INSTALL_TARGET=	install-strip
25
USE_LDCONFIG=	yes
21
USE_LDCONFIG=	yes
26
22
27
OPTIONS_DEFINE=	IPV6 KQUEUE
23
OPTIONS_DEFINE=	KQUEUE
28
OPTIONS_DEFAULT=KQUEUE
24
OPTIONS_DEFAULT=KQUEUE
29
KQUEUE_DESC=	Use kqueue(2) support
25
KQUEUE_DESC=	Use kqueue(2) support
30
26
Lines 32-38 Link Here
32
# linking libtorrent to avoid linking with base's libcrypto.
28
# linking libtorrent to avoid linking with base's libcrypto.
33
MAKE_ARGS=	LDFLAGS="${LDFLAGS}"
29
MAKE_ARGS=	LDFLAGS="${LDFLAGS}"
34
30
35
IPV6_CONFIGURE_ENABLE=	ipv6
36
KQUEUE_CONFIGURE_WITH=	kqueue
31
KQUEUE_CONFIGURE_WITH=	kqueue
37
32
38
.include <bsd.port.pre.mk>
33
.include <bsd.port.pre.mk>
Lines 45-56 Link Here
45
CONFIGURE_ARGS+=--disable-instrumentation
40
CONFIGURE_ARGS+=--disable-instrumentation
46
.endif
41
.endif
47
42
48
# Workaround to build on >= 10.x
49
.if ${OPSYS} == FreeBSD
50
USE_CXXSTD=	c++11
51
EXTRA_PATCHES+=	${FILESDIR}/extra-clang
52
.endif
53
54
post-patch:
43
post-patch:
55
.if ${OPSYS} == FreeBSD
44
.if ${OPSYS} == FreeBSD
56
	@${FIND} ${WRKSRC} \( -name '*.h' -o -name '*.cc' \) -type f \
45
	@${FIND} ${WRKSRC} \( -name '*.h' -o -name '*.cc' \) -type f \
Lines 62-66 Link Here
62
		${WRKSRC}/src/torrent/utils/extents.h \
51
		${WRKSRC}/src/torrent/utils/extents.h \
63
		${WRKSRC}/src/torrent/utils/log.cc
52
		${WRKSRC}/src/torrent/utils/log.cc
64
.endif
53
.endif
54
55
post-install:
56
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libtorrent.so.20.0.0
65
57
66
.include <bsd.port.post.mk>
58
.include <bsd.port.post.mk>
(-)net-p2p/libtorrent/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1518295243
1
TIMESTAMP = 1529447240
2
SHA256 (libtorrent-0.13.6.tar.gz) = 2838a08c96edfd936aff8fbf99ecbb930c2bfca3337dd1482eb5fccdb80d5a04
2
SHA256 (libtorrent-0.13.7.tar.gz) = c738f60f4d7b6879cd2745fb4310bf24c9287219c1fd619706a9d5499ca7ecc1
3
SIZE (libtorrent-0.13.6.tar.gz) = 781253
3
SIZE (libtorrent-0.13.7.tar.gz) = 782854
(-)net-p2p/libtorrent/files/extra-clang (-144 lines)
Lines 1-144 Link Here
1
--- src/data/memory_chunk.cc
2
+++ src/data/memory_chunk.cc
3
@@ -54,6 +54,22 @@
4
 
5
 namespace torrent {
6
 
7
+const int MemoryChunk::prot_exec;
8
+const int MemoryChunk::prot_read;
9
+const int MemoryChunk::prot_write;
10
+const int MemoryChunk::prot_none;
11
+const int MemoryChunk::map_shared;
12
+
13
+const int MemoryChunk::advice_normal;
14
+const int MemoryChunk::advice_random;
15
+const int MemoryChunk::advice_sequential;
16
+const int MemoryChunk::advice_willneed;
17
+const int MemoryChunk::advice_dontneed;
18
+
19
+const int MemoryChunk::sync_sync;
20
+const int MemoryChunk::sync_async;
21
+const int MemoryChunk::sync_invalidate;
22
+
23
 uint32_t MemoryChunk::m_pagesize = getpagesize();
24
 
25
 inline void
26
--- src/protocol/request_list.cc
27
+++ src/protocol/request_list.cc
28
@@ -52,6 +52,8 @@
29
 
30
 namespace torrent {
31
 
32
+const int request_list_constants::bucket_count;
33
+
34
 const instrumentation_enum request_list_constants::instrumentation_added[bucket_count] = {
35
   INSTRUMENTATION_TRANSFER_REQUESTS_QUEUED_ADDED,
36
   INSTRUMENTATION_TRANSFER_REQUESTS_UNORDERED_ADDED,
37
--- src/torrent/data/file.cc
38
+++ src/torrent/data/file.cc
39
@@ -50,6 +50,15 @@
40
 
41
 namespace torrent {
42
 
43
+const int File::flag_active;
44
+const int File::flag_create_queued;
45
+const int File::flag_resize_queued;
46
+const int File::flag_fallocate;
47
+const int File::flag_previously_created;
48
+
49
+const int File::flag_prioritize_first;
50
+const int File::flag_prioritize_last;
51
+
52
 File::File() :
53
   m_fd(-1),
54
   m_protection(0),
55
--- src/torrent/download.cc
56
+++ src/torrent/download.cc
57
@@ -72,6 +72,20 @@
58
 
59
 namespace torrent {
60
 
61
+const int DownloadInfo::flag_open;
62
+const int DownloadInfo::flag_active;
63
+const int DownloadInfo::flag_compact;
64
+const int DownloadInfo::flag_accepting_new_peers;
65
+const int DownloadInfo::flag_accepting_seeders;
66
+const int DownloadInfo::flag_private;
67
+const int DownloadInfo::flag_meta_download;
68
+const int DownloadInfo::flag_pex_enabled;
69
+const int DownloadInfo::flag_pex_active;
70
+
71
+const int DownloadInfo::public_flags;
72
+
73
+const uint32_t DownloadInfo::unlimited;
74
+
75
 const DownloadInfo* Download::info() const { return m_ptr->info(); }
76
 const download_data* Download::data() const { return m_ptr->data(); }
77
 
78
--- src/torrent/peer/connection_list.cc
79
+++ src/torrent/peer/connection_list.cc
80
@@ -60,6 +60,11 @@
81
 
82
 namespace torrent {
83
 
84
+const int ConnectionList::disconnect_available;
85
+const int ConnectionList::disconnect_quick;
86
+const int ConnectionList::disconnect_unwanted;
87
+const int ConnectionList::disconnect_delayed;
88
+
89
 ConnectionList::ConnectionList(DownloadMain* download) :
90
   m_download(download), m_minSize(50), m_maxSize(100) {
91
 }
92
--- src/torrent/utils/log.cc
93
+++ src/torrent/utils/log.cc
94
@@ -189,7 +189,7 @@
95
   pthread_mutex_lock(&log_mutex);
96
   std::for_each(m_first, m_last, std::tr1::bind(&log_slot::operator(),
97
                                                 std::tr1::placeholders::_1,
98
-                                                buffer,
99
+                                                (const char*)buffer,
100
                                                 std::distance(buffer, first),
101
                                                 std::distance(log_groups.begin(), this)));
102
   if (dump_data != NULL)
103
--- src/utils/instrumentation.h
104
+++ src/utils/instrumentation.h
105
@@ -39,6 +39,8 @@
106
 
107
 #include <tr1/array>
108
 
109
+#include <algorithm>
110
+
111
 #include "torrent/common.h"
112
 #include "torrent/utils/log.h"
113
 
114
@@ -118,7 +120,7 @@
115
 
116
 inline void
117
 instrumentation_initialize() {
118
-  instrumentation_values.assign(int64_t());
119
+  std::fill(instrumentation_values.begin(), instrumentation_values.end(), int64_t());
120
 }
121
 
122
 inline void
123
--- src/utils/queue_buckets.h
124
+++ src/utils/queue_buckets.h
125
@@ -251,7 +251,7 @@
126
   instrumentation_update(constants::instrumentation_total[idx], -difference);
127
 
128
   // Consider moving these to a temporary dequeue before releasing:
129
-  std::for_each(begin, end, std::tr1::function<void (value_type)>(&constants::template destroy<value_type>));
130
+  std::for_each(begin, end, std::tr1::function<void (value_type&)>(&constants::template destroy<value_type>));
131
   queue_at(idx).erase(begin, end);
132
 }
133
 
134
--- src/torrent/download_info.h
135
+++ src/torrent/download_info.h
136
@@ -52,7 +52,7 @@
137
 
138
 // This will become a Download 'handle' of kinds.
139
 
140
-class DownloadInfo {
141
+class LIBTORRENT_EXPORT DownloadInfo {
142
 public:
143
   typedef std::tr1::function<uint64_t ()>                              slot_stat_type;
144
 
(-)net-p2p/libtorrent/files/patch-fix-build-bencoders-callers-crash (-45 lines)
Lines 1-45 Link Here
1
# https://github.com/rakshasa/libtorrent/pull/99/files
2
3
--- src/protocol/extensions.cc.orig	2015-08-08 17:01:32.000000000 +0200
4
+++ src/protocol/extensions.cc	2017-12-02 01:46:38.522736000 +0100
5
@@ -394,7 +394,7 @@
6
   if (m_download->info()->is_meta_download() || piece >= pieceEnd) {
7
     // reject: { "msg_type" => 2, "piece" => ... }
8
     m_pendingType = UT_METADATA;
9
-    m_pending = build_bencode(40, "d8:msg_typei2e5:piecei%zuee", piece);
10
+    m_pending = build_bencode(sizeof(size_t) + 36, "d8:msg_typei2e5:piecei%zuee", piece);
11
     return;
12
   }
13
 
14
@@ -407,7 +407,7 @@
15
   // data: { "msg_type" => 1, "piece" => ..., "total_size" => ... } followed by piece data (outside of dictionary)
16
   size_t length = piece == pieceEnd - 1 ? m_download->info()->metadata_size() % metadata_piece_size : metadata_piece_size;
17
   m_pendingType = UT_METADATA;
18
-  m_pending = build_bencode(length + 128, "d8:msg_typei1e5:piecei%zue10:total_sizei%zuee", piece, metadataSize);
19
+  m_pending = build_bencode((2 * sizeof(size_t)) + length + 120, "d8:msg_typei1e5:piecei%zue10:total_sizei%zuee", piece, metadataSize);
20
 
21
   memcpy(m_pending.end(), buffer + (piece << metadata_piece_shift), length);
22
   m_pending.set(m_pending.data(), m_pending.end() + length, m_pending.owned());
23
--- src/protocol/handshake.cc.orig	2015-08-08 17:01:49.000000000 +0200
24
+++ src/protocol/handshake.cc	2017-12-02 01:46:38.523093000 +0100
25
@@ -738,7 +738,7 @@
26
         break;
27
 
28
       if (m_readBuffer.remaining() > m_encryption.length_ia())
29
-        throw internal_error("Read past initial payload after incoming encrypted handshake.");
30
+        throw handshake_error(ConnectionManager::handshake_failed, e_handshake_invalid_value);
31
 
32
       if (m_encryption.crypto() != HandshakeEncryption::crypto_rc4)
33
         m_encryption.info()->set_obfuscated();
34
--- src/torrent/object_stream.cc.orig	2015-08-08 17:01:32.000000000 +0200
35
+++ src/torrent/object_stream.cc	2017-12-02 01:46:38.523350000 +0100
36
@@ -104,7 +104,8 @@
37
   while (first != last && *first >= '0' && *first <= '9')
38
     length = length * 10 + (*first++ - '0');
39
 
40
-  if (length + 1 > (unsigned int)std::distance(first, last) || *first++ != ':')
41
+  if (length + 1 > (unsigned int)std::distance(first, last) || *first++ != ':'
42
+		  || length + 1 == 0)
43
     throw torrent::bencode_error("Invalid bencode data.");
44
   
45
   return raw_string(first, length);
(-)net-p2p/libtorrent/files/patch-src_net_socket__set.h (-18 lines)
Lines 1-18 Link Here
1
--- src/net/socket_set.h.orig	2012-01-19 10:19:26 UTC
2
+++ src/net/socket_set.h
3
@@ -53,12 +53,12 @@
4
 
5
 // Propably should rename to EventSet...
6
 
7
-class SocketSet : private std::vector<Event*, rak::cacheline_allocator<> > {
8
+class SocketSet : private std::vector<Event*, rak::cacheline_allocator<Event *> > {
9
 public:
10
   typedef uint32_t    size_type;
11
 
12
-  typedef std::vector<Event*, rak::cacheline_allocator<> > base_type;
13
-  typedef std::vector<size_type, rak::cacheline_allocator<> > Table;
14
+  typedef std::vector<Event*, rak::cacheline_allocator<Event *> > base_type;
15
+  typedef std::vector<size_type, rak::cacheline_allocator<size_type> > Table;
16
 
17
   static const size_type npos = static_cast<size_type>(-1);
18
 
(-)net-p2p/libtorrent/files/patch-src_torrent_net_socket__address__key.h (+10 lines)
Line 0 Link Here
1
--- src/torrent/net/socket_address_key.h.orig	2018-07-03 23:50:04 UTC
2
+++ src/torrent/net/socket_address_key.h
3
@@ -7,6 +7,7 @@
4
 #include <cstring>
5
 #include <inttypes.h>
6
 #include <netinet/in.h>
7
+#include <sys/socket.h>
8
 
9
 // Unique key for the socket address, excluding port numbers, etc.
10
 
(-)net-p2p/libtorrent/pkg-plist (-2 / +4 lines)
Lines 27-32 Link Here
27
include/torrent/exceptions.h
27
include/torrent/exceptions.h
28
include/torrent/hash_string.h
28
include/torrent/hash_string.h
29
include/torrent/http.h
29
include/torrent/http.h
30
include/torrent/net/socket_address_key.h
30
include/torrent/object.h
31
include/torrent/object.h
31
include/torrent/object_raw_bencode.h
32
include/torrent/object_raw_bencode.h
32
include/torrent/object_static_map.h
33
include/torrent/object_static_map.h
Lines 49-54 Link Here
49
include/torrent/tracker.h
50
include/torrent/tracker.h
50
include/torrent/tracker_controller.h
51
include/torrent/tracker_controller.h
51
include/torrent/tracker_list.h
52
include/torrent/tracker_list.h
53
include/torrent/utils/directory_events.h
52
include/torrent/utils/extents.h
54
include/torrent/utils/extents.h
53
include/torrent/utils/log.h
55
include/torrent/utils/log.h
54
include/torrent/utils/log_buffer.h
56
include/torrent/utils/log_buffer.h
Lines 59-65 Link Here
59
include/torrent/utils/signal_bitfield.h
61
include/torrent/utils/signal_bitfield.h
60
include/torrent/utils/thread_base.h
62
include/torrent/utils/thread_base.h
61
include/torrent/utils/thread_interrupt.h
63
include/torrent/utils/thread_interrupt.h
64
include/torrent/utils/uri_parser.h
62
lib/libtorrent.so
65
lib/libtorrent.so
63
lib/libtorrent.so.19
66
lib/libtorrent.so.20.0.0
64
lib/libtorrent.so.19.0.0
65
libdata/pkgconfig/libtorrent.pc
67
libdata/pkgconfig/libtorrent.pc

Return to bug 229553