1248
|
1 |
--- rtorrent-0.8.2.orig/rak/string_manip.h 2008-05-07 08:19:12.000000000 -0400
|
|
2 |
+++ rtorrent-0.8.2/rak/string_manip.h 2008-06-25 02:14:10.028329996 -0400
|
|
3 |
@@ -62,7 +62,7 @@
|
|
4 |
|
|
5 |
template <typename Sequence>
|
|
6 |
Sequence trim_end(const Sequence& seq) {
|
|
7 |
- if (seq.empty() || !std::isspace(*(--seq.end())))
|
|
8 |
+ if (seq.empty() || !std::isspace(*(seq.end()-1)))
|
|
9 |
return seq;
|
|
10 |
|
|
11 |
typename Sequence::size_type pos = seq.size();
|
|
12 |
@@ -93,7 +93,7 @@
|
|
13 |
|
|
14 |
template <typename Sequence>
|
|
15 |
Sequence trim_end_classic(const Sequence& seq) {
|
|
16 |
- if (seq.empty() || !std::isspace(*(--seq.end()), std::locale::classic()))
|
|
17 |
+ if (seq.empty() || !std::isspace(*(seq.end()-1), std::locale::classic()))
|
|
18 |
return seq;
|
|
19 |
|
|
20 |
typename Sequence::size_type pos = seq.size();
|
|
21 |
--- libtorrent-0.12.2.orig/rak/path.h 2008-05-07 08:19:12.000000000 -0400
|
|
22 |
+++ libtorrent-0.12.2/rak/path.h 2008-06-25 01:57:52.656513911 -0400
|
|
23 |
@@ -42,6 +42,7 @@
|
|
24 |
|
|
25 |
#include <cstdlib>
|
|
26 |
#include <string>
|
|
27 |
+#include <algorithm>
|
|
28 |
|
|
29 |
namespace rak {
|
|
30 |
|
|
31 |
@@ -91,7 +92,7 @@
|
|
32 |
if (home == NULL)
|
|
33 |
return first;
|
|
34 |
|
|
35 |
- first += strlcpy(first, home, std::distance(first, last));
|
|
36 |
+ first += strlcpy(first, home, last-first);
|
|
37 |
|
|
38 |
if (first > last)
|
|
39 |
return last;
|
|
40 |
@@ -99,7 +100,7 @@
|
|
41 |
src++;
|
|
42 |
}
|
|
43 |
|
|
44 |
- return std::max(first + strlcpy(first, src, std::distance(first, last)), last);
|
|
45 |
+ return std::max(first + strlcpy(first, src, last-first), last);
|
|
46 |
}
|
|
47 |
|
|
48 |
}
|
|
49 |
--- rtorrent-0.8.2.orig/rak/unordered_vector.h 2008-05-07 08:19:12.000000000 -0400
|
|
50 |
+++ rtorrent-0.8.2/rak/unordered_vector.h 2008-06-25 02:29:35.381434005 -0400
|
|
51 |
@@ -90,7 +90,7 @@
|
|
52 |
unordered_vector<_Tp>::insert(iterator position, const value_type& x) {
|
|
53 |
Base::push_back(x);
|
|
54 |
|
|
55 |
- return --end();
|
|
56 |
+ return end()-1;
|
|
57 |
}
|
|
58 |
|
|
59 |
template <typename _Tp>
|
|
60 |
--- rtorrent-0.8.2.orig/rak/socket_address.h 2008-05-07 08:19:12.000000000 -0400
|
|
61 |
+++ rtorrent-0.8.2/rak/socket_address.h 2008-06-25 01:58:48.126132462 -0400
|
|
62 |
@@ -50,6 +50,7 @@
|
|
63 |
#include <cstring>
|
|
64 |
#include <string>
|
|
65 |
#include <stdexcept>
|
|
66 |
+#include <algorithm>
|
|
67 |
#include <arpa/inet.h>
|
|
68 |
#include <netinet/in.h>
|
|
69 |
#include <sys/types.h>
|
|
70 |
--- rtorrent-0.8.2.orig/rak/regex.h 2008-05-07 08:19:12.000000000 -0400
|
|
71 |
+++ rtorrent-0.8.2/rak/regex.h 2008-06-25 02:10:05.332867456 -0400
|
|
72 |
@@ -75,7 +75,7 @@
|
|
73 |
std::list<unsigned int> paths;
|
|
74 |
paths.push_front(0);
|
|
75 |
|
|
76 |
- for (std::string::const_iterator itrText = ++text.begin(), lastText = text.end(); itrText != lastText; ++itrText) {
|
|
77 |
+ for (std::string::const_iterator itrText = text.begin()+1, lastText = text.end(); itrText != lastText; ++itrText) {
|
|
78 |
|
|
79 |
for (std::list<unsigned int>::iterator itrPaths = paths.begin(), lastPaths = paths.end(); itrPaths != lastPaths; ) {
|
|
80 |
|
|
81 |
--- rtorrent-0.8.2.orig/rak/algorithm.h 2008-05-07 08:19:12.000000000 -0400
|
|
82 |
+++ rtorrent-0.8.2/rak/algorithm.h 2008-06-25 17:27:39.728352000 -0400
|
1263
|
83 |
@@ -40,6 +40,63 @@
|
1248
|
84 |
#include <algorithm>
|
|
85 |
#include <functional>
|
|
86 |
|
|
87 |
+#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC
|
|
88 |
+namespace std {
|
|
89 |
+ template <class Iterator> struct iterator_traits
|
|
90 |
+ {
|
|
91 |
+ typedef typename Iterator::value_type value_type;
|
|
92 |
+ typedef typename Iterator::difference_type difference_type;
|
|
93 |
+ typedef typename Iterator::pointer pointer;
|
|
94 |
+ typedef typename Iterator::reference reference;
|
|
95 |
+ typedef typename Iterator::iterator_category iterator_category;
|
|
96 |
+ };
|
|
97 |
+ template <class T> struct iterator_traits<T*>
|
|
98 |
+ {
|
|
99 |
+ typedef T value_type;
|
|
100 |
+ typedef ptrdiff_t difference_type;
|
|
101 |
+ typedef T* pointer;
|
|
102 |
+ typedef T& reference;
|
|
103 |
+ typedef random_access_iterator_tag iterator_category;
|
|
104 |
+ };
|
|
105 |
+ template <class T> struct iterator_traits<const T*>
|
|
106 |
+ {
|
|
107 |
+ typedef T value_type;
|
|
108 |
+ typedef ptrdiff_t difference_type;
|
|
109 |
+ typedef const T* pointer;
|
|
110 |
+ typedef const T& reference;
|
|
111 |
+ typedef random_access_iterator_tag iterator_category;
|
|
112 |
+ };
|
|
113 |
+
|
|
114 |
+ template <class ForwardIterator>
|
|
115 |
+ inline typename iterator_traits<ForwardIterator>::difference_type
|
|
116 |
+ distance (ForwardIterator first, ForwardIterator last)
|
|
117 |
+ {
|
|
118 |
+ typename iterator_traits<ForwardIterator>::difference_type n = 0;
|
|
119 |
+ __distance(first, last, n,
|
|
120 |
+ iterator_traits<ForwardIterator>::iterator_category());
|
|
121 |
+ return n;
|
|
122 |
+ }
|
1263
|
123 |
+
|
|
124 |
+ template <class InputIterator, class T>
|
|
125 |
+ inline typename iterator_traits<InputIterator>::difference_type
|
|
126 |
+ count (InputIterator first, InputIterator last, const T& value)
|
|
127 |
+ {
|
|
128 |
+ typename iterator_traits<InputIterator>::difference_type n = 0;
|
|
129 |
+ count(first, last, value, n);
|
|
130 |
+ return n;
|
|
131 |
+ }
|
|
132 |
+
|
|
133 |
+ template <class InputIterator, class Predicate>
|
|
134 |
+ inline typename iterator_traits<InputIterator>::difference_type
|
|
135 |
+ count_if (InputIterator first, InputIterator last, Predicate pred)
|
|
136 |
+ {
|
|
137 |
+ typename iterator_traits<InputIterator>::difference_type n = 0;
|
|
138 |
+ count_if(first, last, pred, n);
|
|
139 |
+ return n;
|
|
140 |
+ }
|
1248
|
141 |
+}
|
|
142 |
+#endif
|
|
143 |
+
|
|
144 |
namespace rak {
|
|
145 |
|
|
146 |
template <typename _InputIter, typename _Function>
|
|
147 |
--- libtorrent-0.12.2.orig/src/download/choke_manager.cc 2008-05-07 08:19:13.000000000 -0400
|
|
148 |
+++ libtorrent-0.12.2/src/download/choke_manager.cc 2008-06-24 13:40:32.322166472 -0400
|
1263
|
149 |
@@ -41,8 +41,10 @@
|
|
150 |
#include <numeric>
|
|
151 |
#include <cstdlib>
|
1248
|
152 |
|
1263
|
153 |
+#include "rak/algorithm.h"
|
1248
|
154 |
#include "protocol/peer_connection_base.h"
|
|
155 |
#include "torrent/peer/connection_list.h"
|
|
156 |
+#include "resource_manager.h"
|
|
157 |
|
|
158 |
#include "choke_manager.h"
|
|
159 |
#include "choke_manager_node.h"
|
1263
|
160 |
@@ -261,7 +263,7 @@
|
1248
|
161 |
rak::less(i * ChokeManager::order_base + (ChokeManager::order_base - 1),
|
|
162 |
rak::mem_ref(&ChokeManager::value_type::second)));
|
|
163 |
|
|
164 |
- if (std::distance(target[i].second, target[i + 1].second) != 0)
|
|
165 |
+ if (target[i].second != target[i + 1].second)
|
|
166 |
weightTotal += weights[i];
|
|
167 |
}
|
|
168 |
|
|
169 |
--- libtorrent-0.12.2.orig/src/download/delegator.cc 2008-05-07 08:19:13.000000000 -0400
|
|
170 |
+++ libtorrent-0.12.2/src/download/delegator.cc 2008-06-24 13:42:52.016431294 -0400
|
|
171 |
@@ -46,7 +46,9 @@
|
|
172 |
#include "torrent/data/block.h"
|
|
173 |
#include "torrent/data/block_list.h"
|
|
174 |
#include "torrent/data/block_transfer.h"
|
|
175 |
+#include "torrent/data/file_list.h"
|
|
176 |
#include "protocol/peer_chunks.h"
|
|
177 |
+#include "download/chunk_selector.h"
|
|
178 |
|
|
179 |
#include "delegator.h"
|
|
180 |
|
|
181 |
--- libtorrent-0.12.2.orig/src/download/download_constructor.cc 2008-05-07 08:19:13.000000000 -0400
|
|
182 |
+++ libtorrent-0.12.2/src/download/download_constructor.cc 2008-06-24 14:56:59.728556042 -0400
|
|
183 |
@@ -317,7 +317,7 @@
|
|
184 |
Path p;
|
|
185 |
p.set_encoding(enc);
|
|
186 |
|
|
187 |
- std::transform(plist.begin(), plist.end(), std::back_inserter(p), std::mem_fun_ref<const Object::string_type&>(&Object::as_string));
|
|
188 |
+ std::transform(((Object::list_type&)plist).begin(), ((Object::list_type&)plist).end(), std::back_inserter(p), std::mem_fun_ref<Object::string_type&>(&Object::as_string));
|
|
189 |
|
|
190 |
return p;
|
|
191 |
}
|
|
192 |
--- libtorrent-0.12.2.orig/src/download/download_info.h 2008-05-07 08:19:13.000000000 -0400
|
|
193 |
+++ libtorrent-0.12.2/src/download/download_info.h 2008-06-28 00:07:50.060545422 -0400
|
|
194 |
@@ -186,10 +186,13 @@
|
|
195 |
};
|
|
196 |
|
|
197 |
// Move somewhere else.
|
|
198 |
+#if defined(__APPLE__) || defined(__SUNPRO_CC)
|
|
199 |
+#pragma pack(1)
|
|
200 |
+#endif
|
|
201 |
struct SocketAddressCompact {
|
|
202 |
- SocketAddressCompact() {}
|
|
203 |
- SocketAddressCompact(uint32_t a, uint16_t p) : addr(a), port(p) {}
|
|
204 |
- SocketAddressCompact(const rak::socket_address_inet* sa) : addr(sa->address_n()), port(sa->port_n()) {}
|
|
205 |
+ //SocketAddressCompact() {}
|
|
206 |
+ //SocketAddressCompact(uint32_t a, uint16_t p) : addr(a), port(p) {}
|
|
207 |
+ //SocketAddressCompact(const rak::socket_address_inet* sa) : addr(sa->address_n()), port(sa->port_n()) {}
|
|
208 |
|
|
209 |
operator rak::socket_address () const {
|
|
210 |
rak::socket_address sa;
|
|
211 |
@@ -205,6 +208,9 @@
|
|
212 |
|
|
213 |
const char* c_str() const { return reinterpret_cast<const char*>(this); }
|
|
214 |
} __attribute__ ((packed));
|
|
215 |
+#if defined(__APPLE__) || defined(__SUNPRO_CC)
|
|
216 |
+#pragma pack()
|
|
217 |
+#endif
|
|
218 |
|
|
219 |
}
|
|
220 |
|
|
221 |
--- libtorrent-0.12.2.orig/src/download/download_main.cc 2008-05-07 08:19:13.000000000 -0400
|
|
222 |
+++ libtorrent-0.12.2/src/download/download_main.cc 2008-06-28 16:05:20.725211632 -0400
|
|
223 |
@@ -356,8 +356,13 @@
|
|
224 |
PeerConnectionBase* pcb = (*itr)->m_ptr();
|
|
225 |
const rak::socket_address* sa = rak::socket_address::cast_from(pcb->peer_info()->socket_address());
|
|
226 |
|
|
227 |
- if (pcb->peer_info()->listen_port() != 0 && sa->family() == rak::socket_address::af_inet)
|
|
228 |
- current.push_back(SocketAddressCompact(sa->sa_inet()->address_n(), pcb->peer_info()->listen_port()));
|
|
229 |
+ if (pcb->peer_info()->listen_port() != 0 && sa->family() == rak::socket_address::af_inet) {
|
|
230 |
+ SocketAddressCompact s = {
|
|
231 |
+ sa->sa_inet()->address_n(),
|
|
232 |
+ pcb->peer_info()->listen_port()
|
|
233 |
+ };
|
|
234 |
+ current.push_back(s);
|
|
235 |
+ }
|
|
236 |
|
|
237 |
if (!pcb->extensions()->is_remote_supported(ProtocolExtension::UT_PEX))
|
|
238 |
continue;
|
|
239 |
--- libtorrent-0.12.2.orig/src/dht/dht_router.cc 2008-05-07 08:19:12.000000000 -0400
|
|
240 |
+++ libtorrent-0.12.2/src/dht/dht_router.cc 2008-06-24 13:22:15.691370259 -0400
|
|
241 |
@@ -88,7 +88,7 @@
|
|
242 |
}
|
|
243 |
|
|
244 |
set_bucket(new DhtBucket(zero_id, ones_id));
|
|
245 |
- m_routingTable.insert(std::make_pair(bucket()->id_range_end(), bucket()));
|
|
246 |
+ m_routingTable.insert(DhtBucketList::value_type(bucket()->id_range_end(), bucket()));
|
|
247 |
|
|
248 |
if (cache.has_key("nodes")) {
|
|
249 |
const Object::map_type& nodes = cache.get_key_map("nodes");
|
|
250 |
@@ -163,12 +163,12 @@
|
|
251 |
if (!create)
|
|
252 |
return NULL;
|
|
253 |
|
|
254 |
- std::pair<DhtTrackerList::accessor, bool> res = m_trackers.insert(std::make_pair(hash, new DhtTracker()));
|
|
255 |
+ std::pair<DhtTrackerList::iterator, bool> res = m_trackers.insert(std::make_pair(hash, new DhtTracker()));
|
|
256 |
|
|
257 |
if (!res.second)
|
|
258 |
throw internal_error("DhtRouter::get_tracker did not actually insert tracker.");
|
|
259 |
|
|
260 |
- return res.first.tracker();
|
|
261 |
+ return (*res.first).second;
|
|
262 |
}
|
|
263 |
|
|
264 |
bool
|
|
265 |
@@ -552,7 +552,7 @@
|
|
266 |
throw internal_error("DhtRouter::split_bucket router ID ended up in wrong bucket.");
|
|
267 |
|
|
268 |
// Insert new bucket with iterator hint = just before current bucket.
|
|
269 |
- DhtBucketList::iterator other = m_routingTable.insert(itr, std::make_pair(newBucket->id_range_end(), newBucket));
|
|
270 |
+ DhtBucketList::iterator other = m_routingTable.insert(itr, DhtBucketList::value_type(newBucket->id_range_end(), newBucket));
|
|
271 |
|
|
272 |
// Check that the bucket we're not adding the node to isn't empty.
|
|
273 |
if (other->second->is_in_range(node->id())) {
|
|
274 |
--- libtorrent-0.12.2.orig/src/dht/dht_router.h 2008-05-07 08:19:12.000000000 -0400
|
|
275 |
+++ libtorrent-0.12.2/src/dht/dht_router.h 2008-06-24 13:05:12.790210488 -0400
|
|
276 |
@@ -137,7 +137,7 @@
|
|
277 |
// Maximum number of potential contacts to keep until bootstrap complete.
|
|
278 |
static const unsigned int num_bootstrap_contacts = 64;
|
|
279 |
|
|
280 |
- typedef std::map<const HashString, DhtBucket*> DhtBucketList;
|
|
281 |
+ typedef std::map<HashString, DhtBucket*> DhtBucketList;
|
|
282 |
|
|
283 |
DhtBucketList::iterator find_bucket(const HashString& id);
|
|
284 |
|
|
285 |
--- libtorrent-0.12.2.orig/src/dht/dht_server.h 2008-05-07 08:19:12.000000000 -0400
|
|
286 |
+++ libtorrent-0.12.2/src/dht/dht_server.h 2008-06-28 00:08:34.254158759 -0400
|
|
287 |
@@ -108,6 +108,9 @@
|
|
288 |
|
|
289 |
typedef std::deque<DhtTransactionPacket*> packet_queue;
|
|
290 |
|
|
291 |
+#if defined(__APPLE__) || defined(__SUNPRO_CC)
|
|
292 |
+#pragma pack(1)
|
|
293 |
+#endif
|
|
294 |
struct compact_node_info {
|
|
295 |
char _id[20];
|
|
296 |
SocketAddressCompact _addr;
|
|
297 |
@@ -115,6 +118,9 @@
|
|
298 |
HashString& id() { return *HashString::cast_from(_id); }
|
|
299 |
rak::socket_address address() { return rak::socket_address(_addr); }
|
|
300 |
} __attribute__ ((packed));
|
|
301 |
+#if defined(__APPLE__) || defined(__SUNPRO_CC)
|
|
302 |
+#pragma pack()
|
|
303 |
+#endif
|
|
304 |
typedef std::list<compact_node_info> node_info_list;
|
|
305 |
|
|
306 |
// Pending transactions.
|
|
307 |
--- libtorrent-0.12.2.orig/src/dht/dht_transaction.cc 2008-05-07 08:19:12.000000000 -0400
|
|
308 |
+++ libtorrent-0.12.2/src/dht/dht_transaction.cc 2008-06-24 13:33:28.590473835 -0400
|
|
309 |
@@ -68,7 +68,7 @@
|
|
310 |
if (m_concurrency != 3)
|
|
311 |
throw internal_error("DhtSearch::~DhtSearch with invalid concurrency limit.");
|
|
312 |
|
|
313 |
- for (accessor itr = begin(); itr != end(); ++itr)
|
|
314 |
+ for (accessor itr = begin(); static_cast<const_accessor>(itr) != end(); ++itr)
|
|
315 |
delete itr.node();
|
|
316 |
}
|
|
317 |
|
|
318 |
@@ -141,7 +141,7 @@
|
|
319 |
// We're done if we can't find any more nodes to contact.
|
|
320 |
m_next = end();
|
|
321 |
|
|
322 |
- for (accessor itr = base_type::begin(); itr != end(); ) {
|
|
323 |
+ for (accessor itr = base_type::begin(); static_cast<const_accessor>(itr) != end(); ) {
|
|
324 |
// If we have all we need, delete current node unless it is
|
|
325 |
// currently being contacted.
|
|
326 |
if (!itr.node()->is_active() && needClosest <= 0 && (!itr.node()->is_good() || needGood <= 0)) {
|
|
327 |
@@ -264,7 +264,7 @@
|
|
328 |
void
|
|
329 |
DhtTransactionPacket::build_buffer(const Object& data) {
|
|
330 |
char buffer[1500]; // If the message would exceed an Ethernet frame, something went very wrong.
|
|
331 |
- object_buffer_t result = object_write_bencode_c(object_write_to_buffer, NULL, std::make_pair(buffer, buffer + sizeof(buffer)), &data);
|
|
332 |
+ object_buffer_t result = object_write_bencode_c(object_write_to_buffer, NULL, std::make_pair((char*)buffer, buffer + sizeof(buffer)), &data);
|
|
333 |
|
|
334 |
m_length = result.second - buffer;
|
|
335 |
m_data = new char[m_length];
|
|
336 |
--- libtorrent-0.12.2.orig/src/dht/dht_bucket.cc 2008-05-07 08:19:12.000000000 -0400
|
|
337 |
+++ libtorrent-0.12.2/src/dht/dht_bucket.cc 2008-06-24 02:41:04.089051646 -0400
|
1263
|
338 |
@@ -36,6 +36,7 @@
|
|
339 |
|
|
340 |
#include "config.h"
|
1248
|
341 |
|
1263
|
342 |
+#include "rak/algorithm.h"
|
|
343 |
#include "torrent/exceptions.h"
|
1248
|
344 |
|
1263
|
345 |
#include "dht_bucket.h"
|
1248
|
346 |
--- libtorrent-0.12.2.orig/src/dht/dht_node.cc 2008-05-07 08:19:12.000000000 -0400
|
|
347 |
+++ libtorrent-0.12.2/src/dht/dht_node.cc 2008-06-28 15:57:24.639449987 -0400
|
|
348 |
@@ -77,7 +77,10 @@
|
|
349 |
DhtNode::store_compact(char* buffer) const {
|
|
350 |
HashString::cast_from(buffer)->assign(data());
|
|
351 |
|
|
352 |
- SocketAddressCompact sa(address()->sa_inet());
|
|
353 |
+ SocketAddressCompact sa = {
|
|
354 |
+ m_socketAddress.sa_inet()->address_n(),
|
|
355 |
+ m_socketAddress.sa_inet()->port_n()
|
|
356 |
+ };
|
|
357 |
std::memcpy(buffer + 20, sa.c_str(), 6);
|
|
358 |
|
|
359 |
return buffer + 26;
|
|
360 |
--- libtorrent-0.12.2.orig/src/dht/dht_server.cc 2008-05-07 08:19:12.000000000 -0400
|
|
361 |
+++ libtorrent-0.12.2/src/dht/dht_server.cc 2008-06-24 13:24:40.374916857 -0400
|
|
362 |
@@ -582,7 +582,7 @@
|
|
363 |
}
|
|
364 |
|
|
365 |
// We know where to insert it, so pass that as hint.
|
|
366 |
- insertItr = m_transactions.insert(insertItr, std::make_pair(transaction->key(id), transaction));
|
|
367 |
+ insertItr = m_transactions.insert(insertItr, transaction_map::value_type(transaction->key(id), transaction));
|
|
368 |
|
|
369 |
create_query(insertItr, id, transaction->address(), priority);
|
|
370 |
|
|
371 |
--- libtorrent-0.12.2.orig/src/dht/dht_tracker.cc 2008-05-07 08:19:12.000000000 -0400
|
|
372 |
+++ libtorrent-0.12.2/src/dht/dht_tracker.cc 2008-06-28 16:03:29.929469325 -0400
|
|
373 |
@@ -47,7 +47,7 @@
|
|
374 |
if (port == 0)
|
|
375 |
return;
|
|
376 |
|
|
377 |
- SocketAddressCompact compact(addr, port);
|
|
378 |
+ SocketAddressCompact compact = { addr, port };
|
|
379 |
|
|
380 |
unsigned int oldest = 0;
|
|
381 |
uint32_t minSeen = ~uint32_t();
|
|
382 |
--- libtorrent-0.12.2.orig/src/protocol/extensions.cc 2008-05-07 08:19:12.000000000 -0400
|
|
383 |
+++ libtorrent-0.12.2/src/protocol/extensions.cc 2008-06-24 15:01:20.887800483 -0400
|
|
384 |
@@ -119,7 +119,7 @@
|
|
385 |
message.insert_key("reqq", 2048); // maximum request queue size
|
|
386 |
|
|
387 |
char buffer[1024];
|
|
388 |
- object_buffer_t result = object_write_bencode_c(object_write_to_buffer, NULL, std::make_pair(buffer, buffer + sizeof(buffer)), &message);
|
|
389 |
+ object_buffer_t result = object_write_bencode_c(object_write_to_buffer, NULL, std::make_pair((char*)buffer, buffer + sizeof(buffer)), &message);
|
|
390 |
|
|
391 |
int length = result.second - buffer;
|
|
392 |
char* copy = new char[length];
|
|
393 |
--- libtorrent-0.12.2.orig/src/protocol/peer_connection_leech.cc 2008-05-07 08:19:12.000000000 -0400
|
|
394 |
+++ libtorrent-0.12.2/src/protocol/peer_connection_leech.cc 2008-06-24 15:19:28.492038823 -0400
|
|
395 |
@@ -697,7 +697,9 @@
|
|
396 |
}
|
|
397 |
}
|
|
398 |
|
|
399 |
+#ifndef __SUNPRO_CC
|
|
400 |
template<>
|
|
401 |
+#endif
|
|
402 |
void
|
|
403 |
PeerConnection<Download::CONNECTION_INITIAL_SEED>::offer_chunk() {
|
|
404 |
// If bytes left to send in this chunk minus bytes about to be sent is zero,
|
|
405 |
@@ -718,7 +720,9 @@
|
|
406 |
m_data.bytesLeft = m_download->file_list()->chunk_index_size(index);
|
|
407 |
}
|
|
408 |
|
|
409 |
+#ifndef __SUNPRO_CC
|
|
410 |
template<>
|
|
411 |
+#endif
|
|
412 |
bool
|
|
413 |
PeerConnection<Download::CONNECTION_INITIAL_SEED>::should_upload() {
|
|
414 |
// For initial seeding, check if chunk is well seeded now, and if so
|
|
415 |
--- libtorrent-0.12.2.orig/src/protocol/handshake_manager.cc 2008-05-07 08:19:12.000000000 -0400
|
|
416 |
+++ libtorrent-0.12.2/src/protocol/handshake_manager.cc 2008-06-24 15:11:50.179786185 -0400
|
1263
|
417 |
@@ -37,6 +37,7 @@
|
|
418 |
#include "config.h"
|
1248
|
419 |
|
1263
|
420 |
#include <rak/socket_address.h>
|
|
421 |
+#include <rak/algorithm.h>
|
1248
|
422 |
|
1263
|
423 |
#include "torrent/exceptions.h"
|
|
424 |
#include "torrent/error.h"
|
1248
|
425 |
--- libtorrent-0.12.2.orig/src/protocol/handshake.cc 2008-05-07 08:19:12.000000000 -0400
|
|
426 |
+++ libtorrent-0.12.2/src/protocol/handshake.cc 2008-06-24 15:05:32.683533289 -0400
|
1263
|
427 |
@@ -36,8 +36,10 @@
|
1248
|
428 |
|
1263
|
429 |
#include "config.h"
|
|
430 |
|
|
431 |
+#include "rak/algorithm.h"
|
1248
|
432 |
#include "download/download_info.h"
|
|
433 |
#include "download/download_main.h"
|
|
434 |
+#include "download/download_manager.h"
|
|
435 |
#include "net/throttle_list.h"
|
|
436 |
#include "torrent/dht_manager.h"
|
|
437 |
#include "torrent/exceptions.h"
|
1263
|
438 |
@@ -324,14 +326,16 @@
|
1248
|
439 |
return false;
|
|
440 |
}
|
|
441 |
|
1263
|
442 |
+ uint32_t len = std::distance(m_readBuffer.position(), itr);
|
1248
|
443 |
+
|
|
444 |
if (m_incoming) {
|
|
445 |
// We've found HASH('req1' + S), skip that and go on reading the
|
|
446 |
// SKEY hash.
|
|
447 |
- m_readBuffer.consume(std::distance(m_readBuffer.position(), itr) + 20);
|
|
448 |
+ m_readBuffer.consume(len + 20);
|
|
449 |
m_state = READ_ENC_SKEY;
|
|
450 |
|
|
451 |
} else {
|
|
452 |
- m_readBuffer.consume(std::distance(m_readBuffer.position(), itr));
|
|
453 |
+ m_readBuffer.consume(len);
|
|
454 |
m_state = READ_ENC_NEGOT;
|
|
455 |
}
|
|
456 |
|
|
457 |
@@ -935,10 +939,12 @@
|
|
458 |
m_writeBuffer.move_end(96);
|
|
459 |
|
|
460 |
int length = random() % enc_pad_size;
|
|
461 |
- char pad[length];
|
|
462 |
+ char* pad = new char[length];
|
|
463 |
|
|
464 |
std::generate_n(pad, length, &::random);
|
|
465 |
m_writeBuffer.write_len(pad, length);
|
|
466 |
+
|
|
467 |
+ delete pad;
|
|
468 |
}
|
|
469 |
|
|
470 |
void
|
|
471 |
--- libtorrent-0.12.2.orig/src/data/memory_chunk.h 2008-05-07 08:19:13.000000000 -0400
|
|
472 |
+++ libtorrent-0.12.2/src/data/memory_chunk.h 2008-06-25 21:14:31.067671826 -0400
|
|
473 |
@@ -47,28 +47,30 @@
|
|
474 |
// Consider information about whetever the memory maps to a file or
|
|
475 |
// not, since mincore etc can only be called on files.
|
|
476 |
|
|
477 |
- static const int prot_exec = PROT_EXEC;
|
|
478 |
- static const int prot_read = PROT_READ;
|
|
479 |
- static const int prot_write = PROT_WRITE;
|
|
480 |
- static const int prot_none = PROT_NONE;
|
|
481 |
- static const int map_shared = MAP_SHARED;
|
|
482 |
+ enum {
|
|
483 |
+ prot_exec = PROT_EXEC,
|
|
484 |
+ prot_read = PROT_READ,
|
|
485 |
+ prot_write = PROT_WRITE,
|
|
486 |
+ prot_none = PROT_NONE,
|
|
487 |
+ map_shared = MAP_SHARED,
|
|
488 |
|
|
489 |
#ifdef USE_MADVISE
|
|
490 |
- static const int advice_normal = MADV_NORMAL;
|
|
491 |
- static const int advice_random = MADV_RANDOM;
|
|
492 |
- static const int advice_sequential = MADV_SEQUENTIAL;
|
|
493 |
- static const int advice_willneed = MADV_WILLNEED;
|
|
494 |
- static const int advice_dontneed = MADV_DONTNEED;
|
|
495 |
+ advice_normal = MADV_NORMAL,
|
|
496 |
+ advice_random = MADV_RANDOM,
|
|
497 |
+ advice_sequential = MADV_SEQUENTIAL,
|
|
498 |
+ advice_willneed = MADV_WILLNEED,
|
|
499 |
+ advice_dontneed = MADV_DONTNEED,
|
|
500 |
#else
|
|
501 |
- static const int advice_normal = 0;
|
|
502 |
- static const int advice_random = 1;
|
|
503 |
- static const int advice_sequential = 2;
|
|
504 |
- static const int advice_willneed = 3;
|
|
505 |
- static const int advice_dontneed = 4;
|
|
506 |
+ advice_normal = 0,
|
|
507 |
+ advice_random = 1,
|
|
508 |
+ advice_sequential = 2,
|
|
509 |
+ advice_willneed = 3,
|
|
510 |
+ advice_dontneed = 4,
|
|
511 |
#endif
|
|
512 |
- static const int sync_sync = MS_SYNC;
|
|
513 |
- static const int sync_async = MS_ASYNC;
|
|
514 |
- static const int sync_invalidate = MS_INVALIDATE;
|
|
515 |
+ sync_sync = MS_SYNC,
|
|
516 |
+ sync_async = MS_ASYNC,
|
|
517 |
+ sync_invalidate = MS_INVALIDATE,
|
|
518 |
+ };
|
|
519 |
|
|
520 |
MemoryChunk() { clear(); }
|
|
521 |
~MemoryChunk() { clear(); }
|
|
522 |
--- libtorrent-0.12.2.orig/src/data/chunk_list.cc 2008-06-25 01:44:37.768468000 -0400
|
|
523 |
+++ libtorrent-0.12.2/src/data/chunk_list.cc 2008-06-25 23:55:12.466495173 -0400
|
|
524 |
@@ -301,27 +301,18 @@
|
|
525 |
|
|
526 |
std::pair<int, bool>
|
|
527 |
ChunkList::sync_options(ChunkListNode* node, int flags) {
|
|
528 |
- // Using if statements since some linkers have problem with static
|
|
529 |
- // const int members inside the ?: operators. The compiler should
|
|
530 |
- // be optimizing this anyway.
|
|
531 |
+ int sync = MemoryChunk::sync_async;
|
|
532 |
+ bool end = true;
|
|
533 |
|
|
534 |
- if (flags & sync_force) {
|
|
535 |
+ if (flags & sync_safe) {
|
|
536 |
|
|
537 |
- if (flags & sync_safe)
|
|
538 |
- return std::make_pair(MemoryChunk::sync_sync, true);
|
|
539 |
+ if (flags & sync_force || node->sync_triggered())
|
|
540 |
+ sync = MemoryChunk::sync_sync;
|
|
541 |
else
|
|
542 |
- return std::make_pair(MemoryChunk::sync_async, true);
|
|
543 |
-
|
|
544 |
- } else if (flags & sync_safe) {
|
|
545 |
-
|
|
546 |
- if (node->sync_triggered())
|
|
547 |
- return std::make_pair(MemoryChunk::sync_sync, true);
|
|
548 |
- else
|
|
549 |
- return std::make_pair(MemoryChunk::sync_async, false);
|
|
550 |
-
|
|
551 |
- } else {
|
|
552 |
- return std::make_pair(MemoryChunk::sync_async, true);
|
|
553 |
+ end = false;
|
|
554 |
}
|
|
555 |
+
|
|
556 |
+ return std::make_pair(sync, end);
|
|
557 |
}
|
|
558 |
|
|
559 |
// Using a rather simple algorithm for now. This should really be more
|
|
560 |
--- libtorrent-0.12.2.orig/src/data/memory_chunk.cc 2008-06-23 17:08:43.395684068 -0400
|
|
561 |
+++ libtorrent-0.12.2/src/data/memory_chunk.cc 2008-06-24 02:39:28.399927218 -0400
|
|
562 |
@@ -152,11 +152,15 @@
|
|
563 |
bool
|
|
564 |
MemoryChunk::is_incore(uint32_t offset, uint32_t length) {
|
|
565 |
uint32_t size = pages_touched(offset, length);
|
|
566 |
- char buf[size];
|
|
567 |
+ char* buf = new char[size];
|
|
568 |
|
|
569 |
incore(buf, offset, length);
|
|
570 |
|
|
571 |
- return std::find(buf, buf + size, 0) == buf + size;
|
|
572 |
+ bool ret = (std::find(buf, buf + size, 0) == buf + size);
|
|
573 |
+
|
|
574 |
+ delete buf;
|
|
575 |
+
|
|
576 |
+ return ret;
|
|
577 |
}
|
|
578 |
|
|
579 |
}
|
|
580 |
--- libtorrent-0.12.2.orig/src/data/hash_torrent.cc 2008-05-07 08:19:13.000000000 -0400
|
|
581 |
+++ libtorrent-0.12.2/src/data/hash_torrent.cc 2008-06-24 02:36:22.017033961 -0400
|
|
582 |
@@ -38,6 +38,7 @@
|
|
583 |
|
|
584 |
#include "data/chunk_list.h"
|
|
585 |
#include "torrent/exceptions.h"
|
|
586 |
+#include "download/download_wrapper.h"
|
|
587 |
|
|
588 |
#include "hash_torrent.h"
|
|
589 |
#include "hash_queue.h"
|
|
590 |
--- libtorrent-0.12.2.orig/src/data/hash_queue.cc 2008-05-07 08:19:13.000000000 -0400
|
|
591 |
+++ libtorrent-0.12.2/src/data/hash_queue.cc 2008-06-23 19:17:24.270411715 -0400
|
|
592 |
@@ -39,6 +39,7 @@
|
|
593 |
#include <functional>
|
|
594 |
|
|
595 |
#include "torrent/exceptions.h"
|
|
596 |
+#include "download/download_wrapper.h"
|
|
597 |
|
|
598 |
#include "hash_queue.h"
|
|
599 |
#include "hash_chunk.h"
|
|
600 |
--- libtorrent-0.12.2.orig/src/data/chunk_part.cc 2008-05-07 08:19:13.000000000 -0400
|
|
601 |
+++ libtorrent-0.12.2/src/data/chunk_part.cc 2008-06-23 19:16:19.997055043 -0400
|
1263
|
602 |
@@ -39,6 +39,7 @@
|
|
603 |
#include <algorithm>
|
|
604 |
#include <unistd.h>
|
|
605 |
|
|
606 |
+#include "rak/algorithm.h"
|
|
607 |
#include "torrent/exceptions.h"
|
|
608 |
#include "chunk_part.h"
|
|
609 |
|
|
610 |
@@ -70,11 +71,13 @@
|
1248
|
611 |
|
|
612 |
int length = size() - pos;
|
|
613 |
int touched = m_chunk.pages_touched(pos, length);
|
|
614 |
- char buf[touched];
|
|
615 |
+ char* buf = new char[touched];
|
|
616 |
|
|
617 |
m_chunk.incore(buf, pos, length);
|
|
618 |
|
1263
|
619 |
int dist = std::distance(buf, std::find(buf, buf + touched, 0));
|
1248
|
620 |
+
|
|
621 |
+ delete buf;
|
|
622 |
|
|
623 |
return std::min(dist ? (dist * m_chunk.page_size() - m_chunk.page_align()) : 0,
|
|
624 |
size() - pos);
|
|
625 |
--- libtorrent-0.12.2.orig/src/data/chunk_list.cc 2008-05-07 08:19:13.000000000 -0400
|
|
626 |
+++ libtorrent-0.12.2/src/data/chunk_list.cc 2008-06-23 19:14:40.468978454 -0400
|
|
627 |
@@ -38,6 +38,8 @@
|
|
628 |
|
|
629 |
#include "torrent/exceptions.h"
|
|
630 |
#include "torrent/chunk_manager.h"
|
|
631 |
+#include "torrent/data/file_utils.h"
|
|
632 |
+#include "download/download_wrapper.h"
|
|
633 |
|
|
634 |
#include "chunk_list.h"
|
|
635 |
#include "chunk.h"
|
1263
|
636 |
@@ -349,16 +351,18 @@
|
1248
|
637 |
bool required = std::find_if(itr, range, std::bind1st(std::mem_fun(&ChunkList::check_node), this)) != range;
|
|
638 |
dontSkip = dontSkip || required;
|
|
639 |
|
|
640 |
- if (!required && std::distance(itr, range) < maxDistance) {
|
1263
|
641 |
+ unsigned int l = range - itr;
|
1248
|
642 |
+
|
|
643 |
+ if (!required && l < maxDistance) {
|
|
644 |
// Don't sync this range.
|
|
645 |
- unsigned int l = std::min(range - itr, itr - first);
|
1263
|
646 |
+ l = std::min(l, (unsigned int)(itr - first));
|
1248
|
647 |
std::swap_ranges(first, first + l, range - l);
|
|
648 |
|
|
649 |
first += l;
|
|
650 |
|
|
651 |
} else {
|
|
652 |
// This probably increases too fast.
|
|
653 |
- weight -= std::distance(itr, range) * std::distance(itr, range);
|
|
654 |
+ weight -= l * l;
|
|
655 |
}
|
|
656 |
|
|
657 |
itr = range;
|
|
658 |
--- libtorrent-0.12.2.orig/src/utils/sha1.h 2008-05-07 08:19:12.000000000 -0400
|
|
659 |
+++ libtorrent-0.12.2/src/utils/sha1.h 2008-06-24 02:34:12.101392402 -0400
|
|
660 |
@@ -37,11 +37,10 @@
|
|
661 |
#ifndef LIBTORRENT_HASH_COMPUTE_H
|
|
662 |
#define LIBTORRENT_HASH_COMPUTE_H
|
|
663 |
|
|
664 |
-#include <cstring>
|
|
665 |
-
|
|
666 |
#if defined USE_NSS_SHA
|
|
667 |
#include "sha_fast.h"
|
|
668 |
#elif defined USE_OPENSSL_SHA
|
|
669 |
+#include <stdlib.h>
|
|
670 |
#include <openssl/sha.h>
|
|
671 |
#else
|
|
672 |
#error "No SHA1 implementation selected, choose between Mozilla's NSS and OpenSSL."
|
|
673 |
--- libtorrent-0.12.2.orig/src/tracker/tracker_http.cc 2008-05-07 08:19:13.000000000 -0400
|
|
674 |
+++ libtorrent-0.12.2/src/tracker/tracker_http.cc 2008-06-24 15:21:07.562782258 -0400
|
|
675 |
@@ -48,6 +48,7 @@
|
|
676 |
#include "torrent/http.h"
|
|
677 |
#include "torrent/object_stream.h"
|
|
678 |
#include "torrent/tracker_list.h"
|
|
679 |
+#include "torrent/data/file_list.h"
|
|
680 |
|
|
681 |
#include "tracker_http.h"
|
|
682 |
|
|
683 |
--- libtorrent-0.12.2.orig/src/tracker/tracker_manager.cc 2008-05-07 08:19:13.000000000 -0400
|
|
684 |
+++ libtorrent-0.12.2/src/tracker/tracker_manager.cc 2008-06-24 15:23:58.547482693 -0400
|
1263
|
685 |
@@ -36,7 +36,9 @@
|
|
686 |
|
1248
|
687 |
#include "config.h"
|
|
688 |
|
1263
|
689 |
+#include "rak/algorithm.h"
|
1248
|
690 |
#include "download/download_info.h"
|
|
691 |
+#include "download/download_wrapper.h"
|
|
692 |
#include "torrent/exceptions.h"
|
|
693 |
#include "torrent/tracker.h"
|
|
694 |
#include "torrent/tracker_list.h"
|
|
695 |
--- libtorrent-0.12.2.orig/src/tracker/tracker_udp.cc 2008-05-07 08:19:13.000000000 -0400
|
|
696 |
+++ libtorrent-0.12.2/src/tracker/tracker_udp.cc 2008-06-24 15:35:31.207275209 -0400
|
|
697 |
@@ -45,6 +45,7 @@
|
|
698 |
#include "torrent/connection_manager.h"
|
|
699 |
#include "torrent/poll.h"
|
|
700 |
#include "torrent/tracker_list.h"
|
|
701 |
+#include "torrent/data/file_list.h"
|
|
702 |
|
|
703 |
#include "tracker_udp.h"
|
|
704 |
#include "manager.h"
|
|
705 |
@@ -325,7 +326,7 @@
|
|
706 |
m_readBuffer->read_32() != m_transactionId)
|
|
707 |
return false;
|
|
708 |
|
|
709 |
- receive_failed("Received error message: " + std::string(m_readBuffer->position(), m_readBuffer->end()));
|
|
710 |
+ receive_failed("Received error message: " + std::string((char*)m_readBuffer->position(), m_readBuffer->remaining()));
|
|
711 |
return true;
|
|
712 |
}
|
|
713 |
|
|
714 |
--- libtorrent-0.12.2.orig/src/torrent/chunk_manager.cc 2008-05-07 08:19:13.000000000 -0400
|
|
715 |
+++ libtorrent-0.12.2/src/torrent/chunk_manager.cc 2008-06-23 18:46:12.474491305 -0400
|
|
716 |
@@ -112,7 +112,7 @@
|
|
717 |
if (itr == base_type::end())
|
|
718 |
throw internal_error("ChunkManager::erase(...) itr == base_type::end().");
|
|
719 |
|
|
720 |
- std::iter_swap(itr, --base_type::end());
|
|
721 |
+ std::iter_swap(itr, base_type::end()-1);
|
|
722 |
base_type::pop_back();
|
|
723 |
|
|
724 |
chunkList->set_manager(NULL);
|
|
725 |
--- libtorrent-0.12.2.orig/src/torrent/peer/connection_list.cc 2008-05-07 08:19:13.000000000 -0400
|
|
726 |
+++ libtorrent-0.12.2/src/torrent/peer/connection_list.cc 2008-06-23 18:42:38.710410872 -0400
|
|
727 |
@@ -141,7 +141,7 @@
|
|
728 |
// Need to do it one connection at the time to ensure that when the
|
|
729 |
// signal is emited everything is in a valid state.
|
|
730 |
while (pos != end())
|
|
731 |
- erase(--end(), flags);
|
|
732 |
+ erase(end()-1, flags);
|
|
733 |
|
|
734 |
m_download->info()->set_accepting_new_peers(size() < m_maxSize);
|
|
735 |
}
|
|
736 |
--- libtorrent-0.12.2.orig/src/torrent/object_stream.cc 2008-05-07 08:19:13.000000000 -0400
|
|
737 |
+++ libtorrent-0.12.2/src/torrent/object_stream.cc 2008-06-23 22:07:52.705714634 -0400
|
1263
|
738 |
@@ -39,6 +39,7 @@
|
|
739 |
#include <iterator>
|
|
740 |
#include <iostream>
|
|
741 |
#include <rak/functional.h>
|
|
742 |
+#include <rak/algorithm.h>
|
1248
|
743 |
|
1263
|
744 |
#include "utils/sha1.h"
|
1248
|
745 |
|
1263
|
746 |
@@ -233,7 +234,7 @@
|
1248
|
747 |
src /= 10;
|
|
748 |
}
|
|
749 |
|
|
750 |
- object_write_bencode_c_string(output, first, 20 - std::distance(buffer, first));
|
|
751 |
+ object_write_bencode_c_string(output, first, 20 - (first - buffer));
|
|
752 |
}
|
|
753 |
|
|
754 |
void
|
|
755 |
--- libtorrent-0.12.2.orig/src/torrent/download.cc 2008-05-07 08:19:13.000000000 -0400
|
|
756 |
+++ libtorrent-0.12.2/src/torrent/download.cc 2008-06-23 18:56:21.847160292 -0400
|
1263
|
757 |
@@ -36,6 +36,7 @@
|
|
758 |
|
|
759 |
#include "config.h"
|
1248
|
760 |
|
1263
|
761 |
+#include <rak/algorithm.h>
|
|
762 |
#include <rak/functional.h>
|
|
763 |
#include <sigc++/adaptors/bind.h>
|
|
764 |
#include <sigc++/adaptors/hide.h>
|
1248
|
765 |
--- libtorrent-0.12.2.orig/src/torrent/data/file_list.cc 2008-06-23 18:17:42.415878000 -0400
|
|
766 |
+++ libtorrent-0.12.2/src/torrent/data/file_list.cc 2008-06-23 18:21:51.029221269 -0400
|
1263
|
767 |
@@ -42,6 +42,7 @@
|
|
768 |
#include <limits>
|
|
769 |
#include <memory>
|
|
770 |
#include <set>
|
|
771 |
+#include <rak/algorithm.h>
|
|
772 |
#include <rak/error_number.h>
|
|
773 |
#include <rak/file_stat.h>
|
|
774 |
#include <rak/fs_stat.h>
|
1248
|
775 |
--- libtorrent-0.12.2.orig/src/torrent/data/file_utils.cc 2008-06-23 18:25:06.488832000 -0400
|
|
776 |
+++ libtorrent-0.12.2/src/torrent/data/file_utils.cc 2008-06-23 18:25:31.066012126 -0400
|
|
777 |
@@ -60,7 +60,7 @@
|
|
778 |
FileList::split_type* splitItr = splitList;
|
|
779 |
|
|
780 |
unsigned int nameSize = srcPath->back().size() + suffix.size();
|
|
781 |
- char name[nameSize + 4];
|
|
782 |
+ char* name = new char[nameSize + 4];
|
|
783 |
|
|
784 |
std::memcpy(name, srcPath->back().c_str(), srcPath->back().size());
|
|
785 |
std::memcpy(name + srcPath->back().size(), suffix.c_str(), suffix.size());
|
|
786 |
@@ -80,6 +80,8 @@
|
|
787 |
splitItr->second.back() = name;
|
|
788 |
}
|
|
789 |
|
|
790 |
+ delete name;
|
|
791 |
+
|
|
792 |
return fileList->split(position, splitList, splitItr).second;
|
|
793 |
}
|
|
794 |
|
|
795 |
--- libtorrent-0.12.2.orig/src/torrent/data/block.cc 2008-05-07 08:19:13.000000000 -0400
|
|
796 |
+++ libtorrent-0.12.2/src/torrent/data/block.cc 2008-06-23 17:24:05.346918013 -0400
|
1263
|
797 |
@@ -38,6 +38,7 @@
|
1248
|
798 |
|
1263
|
799 |
#include <algorithm>
|
|
800 |
#include <functional>
|
|
801 |
+#include <rak/algorithm.h>
|
|
802 |
#include <rak/functional.h>
|
1248
|
803 |
|
1263
|
804 |
#include "peer/peer_info.h"
|
1248
|
805 |
--- libtorrent-0.12.2.orig/src/torrent/data/transfer_list.cc 2008-05-07 08:19:13.000000000 -0400
|
|
806 |
+++ libtorrent-0.12.2/src/torrent/data/transfer_list.cc 2008-06-24 15:09:29.809436919 -0400
|
1263
|
807 |
@@ -39,9 +39,12 @@
|
|
808 |
#include <algorithm>
|
|
809 |
#include <functional>
|
|
810 |
#include <set>
|
|
811 |
+#include <rak/algorithm.h>
|
1248
|
812 |
#include <rak/functional.h>
|
|
813 |
|
|
814 |
#include "data/chunk.h"
|
|
815 |
+#include "download/download_main.h"
|
|
816 |
+#include "download/chunk_selector.h"
|
|
817 |
#include "peer/peer_info.h"
|
|
818 |
|
|
819 |
#include "block_failed.h"
|
|
820 |
--- libtorrent-0.12.2.orig/src/torrent/poll_select.cc 2008-05-07 08:19:13.000000000 -0400
|
|
821 |
+++ libtorrent-0.12.2/src/torrent/poll_select.cc 2008-06-23 19:06:09.911597997 -0400
|
|
822 |
@@ -37,6 +37,7 @@
|
|
823 |
#include "config.h"
|
|
824 |
|
|
825 |
#include <algorithm>
|
|
826 |
+#include <functional>
|
|
827 |
|
|
828 |
#include <unistd.h>
|
|
829 |
#include <sys/time.h>
|
|
830 |
--- libtorrent-0.12.2.orig/src/torrent/hash_string.h 2008-05-07 08:19:13.000000000 -0400
|
|
831 |
+++ libtorrent-0.12.2/src/torrent/hash_string.h 2008-06-23 17:11:39.337687346 -0400
|
|
832 |
@@ -56,8 +56,16 @@
|
|
833 |
typedef const value_type* const_iterator;
|
|
834 |
typedef std::size_t size_type;
|
|
835 |
typedef std::ptrdiff_t difference_type;
|
|
836 |
+#ifndef __SUNPRO_CC
|
|
837 |
typedef std::reverse_iterator<iterator> reverse_iterator;
|
|
838 |
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
|
839 |
+#else
|
|
840 |
+ typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
|
|
841 |
+ int, int&, int*, ptrdiff_t> reverse_iterator;
|
|
842 |
+
|
|
843 |
+ typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
|
|
844 |
+ int, const int&, const int*, ptrdiff_t> const_reverse_iterator;
|
|
845 |
+#endif /* SIGC_HAVE_SUN_REVERSE_ITERATOR */
|
|
846 |
|
|
847 |
static const size_type size_data = 20;
|
|
848 |
|
|
849 |
--- libtorrent-0.12.2.orig/src/torrent/resume.cc 2008-05-07 08:19:13.000000000 -0400
|
|
850 |
+++ libtorrent-0.12.2/src/torrent/resume.cc 2008-06-28 15:58:08.634117091 -0400
|
|
851 |
@@ -310,8 +310,13 @@
|
|
852 |
|
|
853 |
const rak::socket_address* sa = rak::socket_address::cast_from(itr->second->socket_address());
|
|
854 |
|
|
855 |
- if (sa->family() == rak::socket_address::af_inet)
|
|
856 |
- peer.insert_key("inet", std::string(SocketAddressCompact(sa->sa_inet()->address_n(), htons(itr->second->listen_port())).c_str(), sizeof(SocketAddressCompact)));
|
|
857 |
+ if (sa->family() == rak::socket_address::af_inet) {
|
|
858 |
+ SocketAddressCompact s = {
|
|
859 |
+ sa->sa_inet()->address_n(),
|
|
860 |
+ htons(itr->second->listen_port())
|
|
861 |
+ };
|
|
862 |
+ peer.insert_key("inet", std::string(s.c_str(), sizeof(SocketAddressCompact)));
|
|
863 |
+ }
|
|
864 |
|
|
865 |
peer.insert_key("failed", itr->second->failed_counter());
|
|
866 |
peer.insert_key("last", itr->second->is_connected() ? cachedTime.seconds() : itr->second->last_connection());
|
|
867 |
--- libtorrent-0.12.2.orig/src/net/throttle_list.cc 2008-05-07 08:19:12.000000000 -0400
|
|
868 |
+++ libtorrent-0.12.2/src/net/throttle_list.cc 2008-06-24 15:00:32.453025557 -0400
|
|
869 |
@@ -40,6 +40,8 @@
|
|
870 |
#include <limits>
|
|
871 |
#include <torrent/exceptions.h>
|
|
872 |
|
|
873 |
+#include "socket_base.h"
|
|
874 |
+
|
|
875 |
#include "throttle_list.h"
|
|
876 |
#include "throttle_node.h"
|
|
877 |
|
|
878 |
--- libtorrent-0.12.2.orig/src/net/listen.cc 2008-05-07 08:19:12.000000000 -0400
|
|
879 |
+++ libtorrent-0.12.2/src/net/listen.cc 2008-06-24 14:59:01.383033240 -0400
|
|
880 |
@@ -45,6 +45,7 @@
|
|
881 |
#include "torrent/exceptions.h"
|
|
882 |
#include "torrent/connection_manager.h"
|
|
883 |
#include "torrent/poll.h"
|
|
884 |
+#include "protocol/handshake_manager.h"
|
|
885 |
|
|
886 |
#include "listen.h"
|
|
887 |
#include "manager.h"
|