483
|
1 |
diff -ru deluge-0.5.5.orig/setup.py deluge-0.5.5/setup.py
|
|
2 |
--- deluge-0.5.5.orig/setup.py 2007年 9月 17日 一 01:06:08
|
|
3 |
+++ deluge-0.5.5/setup.py 2007年 9月 17日 一 00:49:37
|
435
|
4 |
@@ -96,12 +96,12 @@
|
|
5 |
# it has been removed to prevent confusion.
|
|
6 |
|
|
7 |
if not OS == "win":
|
|
8 |
- EXTRA_COMPILE_ARGS = ["-Wno-missing-braces",
|
|
9 |
+ EXTRA_COMPILE_ARGS = [
|
|
10 |
"-DHAVE_INCLUDE_LIBTORRENT_ASIO____ASIO_HPP=1",
|
|
11 |
"-DHAVE_INCLUDE_LIBTORRENT_ASIO_SSL_STREAM_HPP=1",
|
|
12 |
"-DHAVE_INCLUDE_LIBTORRENT_ASIO_IP_TCP_HPP=1",
|
|
13 |
"-DHAVE_PTHREAD=1", "-DTORRENT_USE_OPENSSL=1", "-DHAVE_SSL=1",
|
|
14 |
- "-DNDEBUG=1", "-O2"]
|
|
15 |
+ "-DNDEBUG=1"]
|
|
16 |
if ARCH == "x64":
|
|
17 |
EXTRA_COMPILE_ARGS.append("-DAMD64")
|
|
18 |
|
483
|
19 |
@@ -175,7 +175,8 @@
|
435
|
20 |
include_dirs = includedirs,
|
|
21 |
libraries = librariestype,
|
|
22 |
extra_compile_args = EXTRA_COMPILE_ARGS,
|
|
23 |
- sources = sources)
|
|
24 |
+ sources = sources,
|
|
25 |
+ language = 'c++')
|
|
26 |
# Thanks to Iain Nicol for code to save the location for installed prefix
|
|
27 |
# At runtime, we need to know where we installed the data to.
|
|
28 |
|
483
|
29 |
diff -ru deluge-0.5.5.orig/libtorrent/include/libtorrent/buffer.hpp deluge-0.5.5/libtorrent/include/libtorrent/buffer.hpp
|
|
30 |
--- deluge-0.5.5.orig/libtorrent/include/libtorrent/buffer.hpp 2007年 9月 3日 一 03:14:45
|
|
31 |
+++ deluge-0.5.5/libtorrent/include/libtorrent/buffer.hpp 2007年 9月 17日 一 00:49:37
|
435
|
32 |
@@ -246,7 +246,7 @@
|
|
33 |
assert(m_write_cursor == m_last);
|
|
34 |
m_write_cursor = m_first;
|
|
35 |
|
|
36 |
- memcpy(m_write_cursor, first, n);
|
|
37 |
+ std::memcpy(m_write_cursor, first, n);
|
|
38 |
m_write_cursor += n;
|
|
39 |
}
|
|
40 |
|
483
|
41 |
diff -ru deluge-0.5.5.orig/libtorrent/include/libtorrent/xml_parse.hpp deluge-0.5.5/libtorrent/include/libtorrent/xml_parse.hpp
|
|
42 |
--- deluge-0.5.5.orig/libtorrent/include/libtorrent/xml_parse.hpp 2007年 9月 17日 一 01:06:03
|
|
43 |
+++ deluge-0.5.5/libtorrent/include/libtorrent/xml_parse.hpp 2007年 9月 17日 一 00:49:37
|
|
44 |
@@ -128,7 +128,7 @@
|
|
45 |
*(p-1) = '?';
|
|
46 |
tag_end = p - 1;
|
|
47 |
}
|
|
48 |
- else if (start + 5 < p && memcmp(start, "!--", 3) == 0 && memcmp(p-2, "--", 2) == 0)
|
|
49 |
+ else if (start + 5 < p && std::memcmp(start, "!--", 3) == 0 && std::memcmp(p-2, "--", 2) == 0)
|
|
50 |
{
|
|
51 |
start += 3;
|
|
52 |
*(p-2) = 0;
|
|
53 |
diff -ru deluge-0.5.5.orig/libtorrent/include/libtorrent/asio/detail/socket_ops.hpp deluge-0.5.5/libtorrent/include/libtorrent/asio/detail/socket_ops.hpp
|
|
54 |
--- deluge-0.5.5.orig/libtorrent/include/libtorrent/asio/detail/socket_ops.hpp 2007年 9月 3日 一 03:14:45
|
|
55 |
+++ deluge-0.5.5/libtorrent/include/libtorrent/asio/detail/socket_ops.hpp 2007年 9月 17日 一 00:49:37
|
435
|
56 |
@@ -130,7 +130,10 @@
|
|
57 |
#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
|
|
58 |
b.buf = static_cast<char*>(data);
|
|
59 |
b.len = static_cast<u_long>(size);
|
|
60 |
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
|
|
61 |
+#elif defined(__SUNPRO_CC)
|
|
62 |
+ b.iov_base = static_cast<char*>(data);
|
|
63 |
+ b.iov_len = size;
|
|
64 |
+#else // defined(__SUNPRO_CC)
|
|
65 |
b.iov_base = data;
|
|
66 |
b.iov_len = size;
|
|
67 |
#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
|
|
68 |
@@ -141,7 +144,10 @@
|
|
69 |
#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
|
|
70 |
b.buf = static_cast<char*>(const_cast<void*>(data));
|
|
71 |
b.len = static_cast<u_long>(size);
|
|
72 |
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
|
|
73 |
+#elif defined(__SUNPRO_CC)
|
|
74 |
+ b.iov_base = static_cast<char*>(const_cast<void*>(data));
|
|
75 |
+ b.iov_len = size;
|
|
76 |
+#else // defined(__SUNPRO_CC)
|
|
77 |
b.iov_base = const_cast<void*>(data);
|
|
78 |
b.iov_len = size;
|
|
79 |
#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
|
483
|
80 |
diff -ru deluge-0.5.5.orig/libtorrent/include/libtorrent/asio/impl/error_code.ipp deluge-0.5.5/libtorrent/include/libtorrent/asio/impl/error_code.ipp
|
|
81 |
--- deluge-0.5.5.orig/libtorrent/include/libtorrent/asio/impl/error_code.ipp 2007年 9月 17日 一 01:06:36
|
|
82 |
+++ deluge-0.5.5/libtorrent/include/libtorrent/asio/impl/error_code.ipp 2007年 9月 17日 一 00:49:37
|
435
|
83 |
@@ -77,16 +77,16 @@
|
|
84 |
if (*this == error::socket_type_not_supported)
|
|
85 |
return "Socket type not supported.";
|
|
86 |
#if defined(__sun) || defined(__QNX__)
|
|
87 |
- return strerror(value_);
|
|
88 |
+ return std::strerror(value_);
|
|
89 |
#elif defined(__MACH__) && defined(__APPLE__) \
|
|
90 |
|| defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \
|
|
91 |
|| defined(_AIX)
|
|
92 |
char buf[256] = "";
|
|
93 |
- strerror_r(value_, buf, sizeof(buf));
|
|
94 |
+ std::strerror_r(value_, buf, sizeof(buf));
|
|
95 |
return buf;
|
|
96 |
#else
|
|
97 |
char buf[256] = "";
|
|
98 |
- return strerror_r(value_, buf, sizeof(buf));
|
|
99 |
+ return std::strerror_r(value_, buf, sizeof(buf));
|
|
100 |
#endif
|
|
101 |
#endif // defined(BOOST_WINDOWS)
|
|
102 |
}
|
483
|
103 |
diff -ru deluge-0.5.5.orig/libtorrent/src/file.cpp deluge-0.5.5/libtorrent/src/file.cpp
|
|
104 |
--- deluge-0.5.5.orig/libtorrent/src/file.cpp 2007年 9月 17日 一 01:06:04
|
|
105 |
+++ deluge-0.5.5/libtorrent/src/file.cpp 2007年 9月 17日 一 00:49:37
|
|
106 |
@@ -183,7 +183,7 @@
|
|
107 |
{
|
|
108 |
std::stringstream msg;
|
|
109 |
msg << "open failed: '" << path.native_file_string() << "'. "
|
|
110 |
- << strerror(errno);
|
|
111 |
+ << std::strerror(errno);
|
|
112 |
throw file_error(msg.str());
|
|
113 |
}
|
|
114 |
m_open_mode = mode;
|
|
115 |
@@ -215,7 +215,7 @@
|
|
116 |
if (ret == -1)
|
|
117 |
{
|
|
118 |
std::stringstream msg;
|
|
119 |
- msg << "read failed: " << strerror(errno);
|
|
120 |
+ msg << "read failed: " << std::strerror(errno);
|
|
121 |
throw file_error(msg.str());
|
|
122 |
}
|
|
123 |
return ret;
|
|
124 |
@@ -239,7 +239,7 @@
|
|
125 |
if (ret == -1)
|
|
126 |
{
|
|
127 |
std::stringstream msg;
|
|
128 |
- msg << "write failed: " << strerror(errno);
|
|
129 |
+ msg << "write failed: " << std::strerror(errno);
|
|
130 |
throw file_error(msg.str());
|
|
131 |
}
|
|
132 |
return ret;
|
|
133 |
@@ -280,7 +280,7 @@
|
|
134 |
if (ret == -1)
|
|
135 |
{
|
|
136 |
std::stringstream msg;
|
|
137 |
- msg << "seek failed: '" << strerror(errno)
|
|
138 |
+ msg << "seek failed: '" << std::strerror(errno)
|
|
139 |
<< "' fd: " << m_fd
|
|
140 |
<< " offset: " << offset
|
|
141 |
<< " seekdir: " << seekdir;
|
|
142 |
diff -ru deluge-0.5.5.orig/libtorrent/src/http_stream.cpp deluge-0.5.5/libtorrent/src/http_stream.cpp
|
|
143 |
--- deluge-0.5.5.orig/libtorrent/src/http_stream.cpp 2007年 9月 17日 一 01:06:07
|
|
144 |
+++ deluge-0.5.5/libtorrent/src/http_stream.cpp 2007年 9月 17日 一 00:49:37
|
|
145 |
@@ -130,7 +130,7 @@
|
|
146 |
if (found_end)
|
|
147 |
{
|
|
148 |
m_buffer.push_back(0);
|
|
149 |
- char* status = strchr(&m_buffer[0], ' ');
|
|
150 |
+ char* status = std::strchr(&m_buffer[0], ' ');
|
|
151 |
if (status == 0)
|
|
152 |
{
|
|
153 |
(*h)(asio::error::operation_not_supported);
|
|
154 |
@@ -139,7 +139,7 @@
|
|
155 |
}
|
|
156 |
|
|
157 |
status++;
|
|
158 |
- int code = atoi(status);
|
|
159 |
+ int code = std::atoi(status);
|
|
160 |
if (code != 200)
|
|
161 |
{
|
|
162 |
(*h)(asio::error::operation_not_supported);
|
|
163 |
diff -ru deluge-0.5.5.orig/libtorrent/src/lsd.cpp deluge-0.5.5/libtorrent/src/lsd.cpp
|
|
164 |
--- deluge-0.5.5.orig/libtorrent/src/lsd.cpp 2007年 9月 17日 一 01:06:04
|
|
165 |
+++ deluge-0.5.5/libtorrent/src/lsd.cpp 2007年 9月 17日 一 00:49:37
|
|
166 |
@@ -202,13 +202,13 @@
|
|
167 |
if (line == end) break;
|
|
168 |
*line = 0;
|
|
169 |
for (char* i = p; i < line; ++i) *i = std::tolower(*i);
|
|
170 |
- if (line - p >= 5 && memcmp(p, "port:", 5) == 0)
|
|
171 |
+ if (line - p >= 5 && std::memcmp(p, "port:", 5) == 0)
|
|
172 |
{
|
|
173 |
p += 5;
|
|
174 |
while (*p == ' ') ++p;
|
|
175 |
- port = atoi(p);
|
|
176 |
+ port = std::atoi(p);
|
|
177 |
}
|
|
178 |
- else if (line - p >= 9 && memcmp(p, "infohash:", 9) == 0)
|
|
179 |
+ else if (line - p >= 9 && std::memcmp(p, "infohash:", 9) == 0)
|
|
180 |
{
|
|
181 |
p += 9;
|
|
182 |
while (*p == ' ') ++p;
|
|
183 |
diff -ru deluge-0.5.5.orig/libtorrent/src/piece_picker.cpp deluge-0.5.5/libtorrent/src/piece_picker.cpp
|
|
184 |
--- deluge-0.5.5.orig/libtorrent/src/piece_picker.cpp 2007年 9月 17日 一 01:06:07
|
|
185 |
+++ deluge-0.5.5/libtorrent/src/piece_picker.cpp 2007年 9月 17日 一 00:56:37
|
|
186 |
@@ -508,7 +508,7 @@
|
|
187 |
{
|
|
188 |
// find a random position in the destination vector where we will place
|
|
189 |
// this entry.
|
|
190 |
- int dst_index = rand() % m_piece_info[priority].size();
|
|
191 |
+ int dst_index = std::rand() % m_piece_info[priority].size();
|
|
192 |
|
|
193 |
// copy the entry at that position to the back
|
|
194 |
m_piece_map[m_piece_info[priority][dst_index]].index
|
|
195 |
@@ -580,7 +580,7 @@
|
|
196 |
{
|
|
197 |
// find a random position in the destination vector where we will place
|
|
198 |
// this entry.
|
|
199 |
- int dst_index = rand() % m_piece_info[new_priority].size();
|
|
200 |
+ int dst_index = std::rand() % m_piece_info[new_priority].size();
|
|
201 |
|
|
202 |
// copy the entry at that position to the back
|
|
203 |
m_piece_map[m_piece_info[new_priority][dst_index]].index
|
|
204 |
@@ -1142,7 +1142,7 @@
|
|
205 |
// we're not using rarest first (only for the first
|
|
206 |
// bucket, since that's where the currently downloading
|
|
207 |
// pieces are)
|
|
208 |
- int start_piece = rand() % m_piece_map.size();
|
|
209 |
+ int start_piece = std::rand() % m_piece_map.size();
|
|
210 |
int piece = start_piece;
|
|
211 |
while (num_blocks > 0)
|
|
212 |
{
|
|
213 |
diff -ru deluge-0.5.5.orig/libtorrent/src/session.cpp deluge-0.5.5/libtorrent/src/session.cpp
|
|
214 |
--- deluge-0.5.5.orig/libtorrent/src/session.cpp 2007年 9月 17日 一 01:06:06
|
|
215 |
+++ deluge-0.5.5/libtorrent/src/session.cpp 2007年 9月 17日 一 00:49:37
|
|
216 |
@@ -77,7 +77,6 @@
|
|
217 |
using boost::shared_ptr;
|
|
218 |
using boost::weak_ptr;
|
|
219 |
using boost::bind;
|
|
220 |
-using boost::mutex;
|
|
221 |
using libtorrent::aux::session_impl;
|
|
222 |
|
|
223 |
namespace libtorrent
|
|
224 |
diff -ru deluge-0.5.5.orig/libtorrent/src/session_impl.cpp deluge-0.5.5/libtorrent/src/session_impl.cpp
|
|
225 |
--- deluge-0.5.5.orig/libtorrent/src/session_impl.cpp 2007年 9月 8日 六 14:57:16
|
|
226 |
+++ deluge-0.5.5/libtorrent/src/session_impl.cpp 2007年 9月 17日 一 00:49:37
|
|
227 |
@@ -93,7 +93,6 @@
|
|
228 |
using boost::shared_ptr;
|
|
229 |
using boost::weak_ptr;
|
|
230 |
using boost::bind;
|
|
231 |
-using boost::mutex;
|
|
232 |
using libtorrent::aux::session_impl;
|
|
233 |
|
|
234 |
namespace libtorrent {
|
|
235 |
@@ -203,7 +202,7 @@
|
|
236 |
|
|
237 |
// lock the session to add the new torrent
|
|
238 |
session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
|
|
239 |
- mutex::scoped_lock l2(m_mutex);
|
|
240 |
+ boost::mutex::scoped_lock l2(m_mutex);
|
|
241 |
// clear the resume data now that it has been used
|
|
242 |
// (the fast resume data is now parsed and stored in t)
|
|
243 |
t->resume_data = entry();
|
|
244 |
@@ -273,7 +272,7 @@
|
|
245 |
// This will happen if the storage fails to initialize
|
|
246 |
// for example if one of the files has an invalid filename.
|
|
247 |
session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
|
|
248 |
- mutex::scoped_lock l2(m_mutex);
|
|
249 |
+ boost::mutex::scoped_lock l2(m_mutex);
|
|
250 |
|
|
251 |
if (m_ses.m_alerts.should_post(alert::fatal))
|
|
252 |
{
|
|
253 |
@@ -292,7 +291,7 @@
|
|
254 |
#ifndef NDEBUG
|
|
255 |
std::cerr << "error while checking resume data\n";
|
|
256 |
#endif
|
|
257 |
- mutex::scoped_lock l(m_mutex);
|
|
258 |
+ boost::mutex::scoped_lock l(m_mutex);
|
|
259 |
assert(!m_torrents.empty());
|
|
260 |
m_torrents.pop_front();
|
|
261 |
assert(false);
|
|
262 |
@@ -309,7 +308,7 @@
|
|
263 |
boost::tie(finished, progress) = processing->torrent_ptr->check_files();
|
|
264 |
|
|
265 |
{
|
|
266 |
- mutex::scoped_lock l(m_mutex);
|
|
267 |
+ boost::mutex::scoped_lock l(m_mutex);
|
|
268 |
|
|
269 |
INVARIANT_CHECK;
|
|
270 |
|
|
271 |
@@ -335,7 +334,7 @@
|
|
272 |
{
|
|
273 |
// lock the session to add the new torrent
|
|
274 |
session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
|
|
275 |
- mutex::scoped_lock l2(m_mutex);
|
|
276 |
+ boost::mutex::scoped_lock l2(m_mutex);
|
|
277 |
|
|
278 |
INVARIANT_CHECK;
|
|
279 |
|
|
280 |
@@ -390,7 +389,7 @@
|
|
281 |
{
|
|
282 |
// This will happen if the storage fails to initialize
|
|
283 |
session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
|
|
284 |
- mutex::scoped_lock l2(m_mutex);
|
|
285 |
+ boost::mutex::scoped_lock l2(m_mutex);
|
|
286 |
|
|
287 |
if (m_ses.m_alerts.should_post(alert::fatal))
|
|
288 |
{
|
|
289 |
@@ -416,7 +415,7 @@
|
|
290 |
#ifndef NDEBUG
|
|
291 |
std::cerr << "error while checking files\n";
|
|
292 |
#endif
|
|
293 |
- mutex::scoped_lock l(m_mutex);
|
|
294 |
+ boost::mutex::scoped_lock l(m_mutex);
|
|
295 |
assert(!m_processing.empty());
|
|
296 |
|
|
297 |
processing.reset();
|
|
298 |
@@ -610,7 +609,7 @@
|
|
299 |
m_io_service.stop();
|
|
300 |
l.unlock();
|
|
301 |
|
|
302 |
- mutex::scoped_lock l2(m_checker_impl.m_mutex);
|
|
303 |
+ boost::mutex::scoped_lock l2(m_checker_impl.m_mutex);
|
|
304 |
// abort the checker thread
|
|
305 |
m_checker_impl.m_abort = true;
|
|
306 |
}
|
|
307 |
@@ -1439,7 +1438,7 @@
|
|
308 |
std::vector<torrent_handle> session_impl::get_torrents()
|
|
309 |
{
|
|
310 |
mutex_t::scoped_lock l(m_mutex);
|
|
311 |
- mutex::scoped_lock l2(m_checker_impl.m_mutex);
|
|
312 |
+ boost::mutex::scoped_lock l2(m_checker_impl.m_mutex);
|
|
313 |
std::vector<torrent_handle> ret;
|
|
314 |
for (std::deque<boost::shared_ptr<aux::piece_checker_data> >::iterator i
|
|
315 |
= m_checker_impl.m_torrents.begin()
|
|
316 |
@@ -1493,7 +1492,7 @@
|
|
317 |
|
|
318 |
// lock the session and the checker thread (the order is important!)
|
|
319 |
mutex_t::scoped_lock l(m_mutex);
|
|
320 |
- mutex::scoped_lock l2(m_checker_impl.m_mutex);
|
|
321 |
+ boost::mutex::scoped_lock l2(m_checker_impl.m_mutex);
|
|
322 |
|
|
323 |
INVARIANT_CHECK;
|
|
324 |
|
|
325 |
@@ -1568,7 +1567,7 @@
|
|
326 |
assert(!save_path.empty());
|
|
327 |
{
|
|
328 |
// lock the checker_thread
|
|
329 |
- mutex::scoped_lock l(m_checker_impl.m_mutex);
|
|
330 |
+ boost::mutex::scoped_lock l(m_checker_impl.m_mutex);
|
|
331 |
|
|
332 |
// is the torrent currently being checked?
|
|
333 |
if (m_checker_impl.find_torrent(info_hash))
|
|
334 |
@@ -1665,7 +1664,7 @@
|
|
335 |
|
|
336 |
if (h.m_chk)
|
|
337 |
{
|
|
338 |
- mutex::scoped_lock l(m_checker_impl.m_mutex);
|
|
339 |
+ boost::mutex::scoped_lock l(m_checker_impl.m_mutex);
|
|
340 |
|
|
341 |
aux::piece_checker_data* d = m_checker_impl.find_torrent(h.m_info_hash);
|
|
342 |
if (d != 0)
|
|
343 |
@@ -1998,7 +1997,7 @@
|
|
344 |
// destructed and then the invariant will be broken).
|
|
345 |
|
|
346 |
{
|
|
347 |
- mutex::scoped_lock l(m_checker_impl.m_mutex);
|
|
348 |
+ boost::mutex::scoped_lock l(m_checker_impl.m_mutex);
|
|
349 |
// abort the checker thread
|
|
350 |
m_checker_impl.m_abort = true;
|
|
351 |
|
|
352 |
diff -ru deluge-0.5.5.orig/libtorrent/src/sha1.cpp deluge-0.5.5/libtorrent/src/sha1.cpp
|
|
353 |
--- deluge-0.5.5.orig/libtorrent/src/sha1.cpp 2007年 9月 3日 一 03:14:45
|
|
354 |
+++ deluge-0.5.5/libtorrent/src/sha1.cpp 2007年 9月 17日 一 00:49:37
|
435
|
355 |
@@ -20,7 +20,6 @@
|
|
356 |
// #include <stdint.h>
|
|
357 |
|
|
358 |
#include <boost/cstdint.hpp>
|
|
359 |
-using boost::uint32_t;
|
|
360 |
using boost::uint8_t;
|
|
361 |
|
|
362 |
#include "libtorrent/config.hpp"
|
442
|
363 |
@@ -27,13 +26,13 @@
|
|
364 |
|
|
365 |
struct TORRENT_EXPORT SHA_CTX
|
|
366 |
{
|
|
367 |
- uint32_t state[5];
|
|
368 |
- uint32_t count[2];
|
|
369 |
+ boost::uint32_t state[5];
|
|
370 |
+ boost::uint32_t count[2];
|
|
371 |
uint8_t buffer[64];
|
|
372 |
};
|
|
373 |
|
|
374 |
TORRENT_EXPORT void SHA1_Init(SHA_CTX* context);
|
|
375 |
-TORRENT_EXPORT void SHA1_Update(SHA_CTX* context, uint8_t const* data, uint32_t len);
|
|
376 |
+TORRENT_EXPORT void SHA1_Update(SHA_CTX* context, uint8_t const* data, boost::uint32_t len);
|
|
377 |
TORRENT_EXPORT void SHA1_Final(uint8_t* digest, SHA_CTX* context);
|
|
378 |
|
|
379 |
namespace
|
|
380 |
@@ -41,7 +40,7 @@
|
|
381 |
union CHAR64LONG16
|
|
382 |
{
|
|
383 |
uint8_t c[64];
|
|
384 |
- uint32_t l[16];
|
|
385 |
+ boost::uint32_t l[16];
|
|
386 |
};
|
|
387 |
|
|
388 |
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
|
|
389 |
@@ -50,7 +49,7 @@
|
|
390 |
// I got the idea of expanding during the round function from SSLeay
|
|
391 |
struct little_endian_blk0
|
|
392 |
{
|
|
393 |
- static uint32_t apply(CHAR64LONG16* block, int i)
|
|
394 |
+ static boost::uint32_t apply(CHAR64LONG16* block, int i)
|
|
395 |
{
|
|
396 |
return block->l[i] = (rol(block->l[i],24)&0xFF00FF00)
|
|
397 |
| (rol(block->l[i],8)&0x00FF00FF);
|
|
398 |
@@ -59,7 +58,7 @@
|
|
399 |
|
|
400 |
struct big_endian_blk0
|
|
401 |
{
|
|
402 |
- static uint32_t apply(CHAR64LONG16* block, int i)
|
|
403 |
+ static boost::uint32_t apply(CHAR64LONG16* block, int i)
|
|
404 |
{
|
|
405 |
return block->l[i];
|
|
406 |
}
|
|
407 |
@@ -78,10 +77,10 @@
|
|
408 |
|
|
409 |
// Hash a single 512-bit block. This is the core of the algorithm.
|
|
410 |
template <class BlkFun>
|
|
411 |
- void SHA1Transform(uint32_t state[5], uint8_t const buffer[64])
|
|
412 |
+ void SHA1Transform(boost::uint32_t state[5], uint8_t const buffer[64])
|
|
413 |
{
|
|
414 |
using namespace std;
|
|
415 |
- uint32_t a, b, c, d, e;
|
|
416 |
+ boost::uint32_t a, b, c, d, e;
|
|
417 |
|
|
418 |
CHAR64LONG16* block;
|
|
419 |
uint8_t workspace[64];
|
|
420 |
@@ -136,10 +135,10 @@
|
|
421 |
}
|
|
422 |
|
|
423 |
template <class BlkFun>
|
|
424 |
- void internal_update(SHA_CTX* context, uint8_t const* data, uint32_t len)
|
|
425 |
+ void internal_update(SHA_CTX* context, uint8_t const* data, boost::uint32_t len)
|
|
426 |
{
|
|
427 |
using namespace std;
|
|
428 |
- uint32_t i, j; // JHB
|
|
429 |
+ boost::uint32_t i, j; // JHB
|
|
430 |
|
|
431 |
#ifdef VERBOSE
|
|
432 |
SHAPrintContext(context, "before");
|
|
433 |
@@ -169,7 +168,7 @@
|
|
434 |
|
|
435 |
bool is_big_endian()
|
|
436 |
{
|
|
437 |
- uint32_t test = 1;
|
|
438 |
+ boost::uint32_t test = 1;
|
|
439 |
return *reinterpret_cast<uint8_t*>(&test) == 0;
|
|
440 |
}
|
|
441 |
}
|
|
442 |
@@ -190,7 +189,7 @@
|
|
443 |
|
|
444 |
// Run your data through this.
|
|
445 |
|
|
446 |
-void SHA1_Update(SHA_CTX* context, uint8_t const* data, uint32_t len)
|
|
447 |
+void SHA1_Update(SHA_CTX* context, uint8_t const* data, boost::uint32_t len)
|
|
448 |
{
|
|
449 |
#if defined __BIG_ENDIAN__
|
|
450 |
internal_update<big_endian_blk0>(context, data, len);
|
|
451 |
@@ -213,7 +212,7 @@
|
|
452 |
{
|
|
453 |
uint8_t finalcount[8];
|
|
454 |
|
|
455 |
- for (uint32_t i = 0; i < 8; ++i)
|
|
456 |
+ for (boost::uint32_t i = 0; i < 8; ++i)
|
|
457 |
{
|
|
458 |
// Endian independent
|
|
459 |
finalcount[i] = static_cast<uint8_t>(
|
|
460 |
@@ -226,7 +225,7 @@
|
|
461 |
SHA1_Update(context, (uint8_t const*)"\0", 1);
|
|
462 |
SHA1_Update(context, finalcount, 8); // Should cause a SHA1Transform()
|
|
463 |
|
|
464 |
- for (uint32_t i = 0; i < 20; ++i)
|
|
465 |
+ for (boost::uint32_t i = 0; i < 20; ++i)
|
|
466 |
{
|
|
467 |
digest[i] = static_cast<unsigned char>(
|
|
468 |
(context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
|
483
|
469 |
diff -ru deluge-0.5.5.orig/libtorrent/src/storage.cpp deluge-0.5.5/libtorrent/src/storage.cpp
|
|
470 |
--- deluge-0.5.5.orig/libtorrent/src/storage.cpp 2007年 9月 17日 一 01:06:08
|
|
471 |
+++ deluge-0.5.5/libtorrent/src/storage.cpp 2007年 9月 17日 一 00:49:37
|
|
472 |
@@ -2027,7 +2027,7 @@
|
|
473 |
|
|
474 |
const int stack_buffer_size = 16*1024;
|
|
475 |
char zeroes[stack_buffer_size];
|
|
476 |
- memset(zeroes, 0, stack_buffer_size);
|
|
477 |
+ std::memset(zeroes, 0, stack_buffer_size);
|
|
478 |
|
|
479 |
bool written = false;
|
|
480 |
|
|
481 |
diff -ru deluge-0.5.5.orig/libtorrent/src/torrent.cpp deluge-0.5.5/libtorrent/src/torrent.cpp
|
|
482 |
--- deluge-0.5.5.orig/libtorrent/src/torrent.cpp 2007年 9月 17日 一 01:06:05
|
|
483 |
+++ deluge-0.5.5/libtorrent/src/torrent.cpp 2007年 9月 17日 一 00:49:37
|
|
484 |
@@ -78,7 +78,6 @@
|
|
485 |
using boost::tuples::get;
|
|
486 |
using boost::tuples::make_tuple;
|
|
487 |
using boost::bind;
|
|
488 |
-using boost::mutex;
|
|
489 |
using libtorrent::aux::session_impl;
|
|
490 |
|
|
491 |
namespace
|
|
492 |
diff -ru deluge-0.5.5.orig/libtorrent/src/torrent_handle.cpp deluge-0.5.5/libtorrent/src/torrent_handle.cpp
|
|
493 |
--- deluge-0.5.5.orig/libtorrent/src/torrent_handle.cpp 2007年 9月 3日 一 03:14:45
|
|
494 |
+++ deluge-0.5.5/libtorrent/src/torrent_handle.cpp 2007年 9月 17日 一 00:55:30
|
435
|
495 |
@@ -75,7 +75,6 @@
|
|
496 |
#endif
|
|
497 |
|
|
498 |
using boost::bind;
|
|
499 |
-using boost::mutex;
|
|
500 |
using libtorrent::aux::session_impl;
|
|
501 |
|
|
502 |
namespace libtorrent
|
483
|
503 |
@@ -130,7 +129,7 @@
|
|
504 |
assert(max_uploads >= 2 || max_uploads == -1);
|
|
505 |
|
|
506 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
507 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
508 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
509 |
find_torrent(m_ses, m_chk, m_info_hash)->set_max_uploads(max_uploads);
|
|
510 |
}
|
|
511 |
|
|
512 |
@@ -139,7 +138,7 @@
|
|
513 |
INVARIANT_CHECK;
|
|
514 |
|
|
515 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
516 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
517 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
518 |
find_torrent(m_ses, m_chk, m_info_hash)->use_interface(net_interface);
|
|
519 |
}
|
|
520 |
|
|
521 |
@@ -150,7 +149,7 @@
|
|
522 |
assert(max_connections >= 2 || max_connections == -1);
|
|
523 |
|
|
524 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
525 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
526 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
527 |
find_torrent(m_ses, m_chk, m_info_hash)->set_max_connections(max_connections);
|
|
528 |
}
|
|
529 |
|
|
530 |
@@ -160,7 +159,7 @@
|
|
531 |
assert(limit >= -1);
|
|
532 |
|
|
533 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
534 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
535 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
536 |
find_torrent(m_ses, m_chk, m_info_hash)->set_peer_upload_limit(ip, limit);
|
|
537 |
}
|
|
538 |
|
|
539 |
@@ -170,7 +169,7 @@
|
|
540 |
assert(limit >= -1);
|
|
541 |
|
|
542 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
543 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
544 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
545 |
find_torrent(m_ses, m_chk, m_info_hash)->set_peer_download_limit(ip, limit);
|
|
546 |
}
|
|
547 |
|
|
548 |
@@ -181,7 +180,7 @@
|
|
549 |
assert(limit >= -1);
|
|
550 |
|
|
551 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
552 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
553 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
554 |
find_torrent(m_ses, m_chk, m_info_hash)->set_upload_limit(limit);
|
|
555 |
}
|
|
556 |
|
|
557 |
@@ -189,7 +188,7 @@
|
|
558 |
{
|
|
559 |
INVARIANT_CHECK;
|
|
560 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
561 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
562 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
563 |
return find_torrent(m_ses, m_chk, m_info_hash)->upload_limit();
|
|
564 |
}
|
|
565 |
|
|
566 |
@@ -200,7 +199,7 @@
|
|
567 |
assert(limit >= -1);
|
|
568 |
|
|
569 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
570 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
571 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
572 |
find_torrent(m_ses, m_chk, m_info_hash)->set_download_limit(limit);
|
|
573 |
}
|
|
574 |
|
|
575 |
@@ -209,7 +208,7 @@
|
|
576 |
INVARIANT_CHECK;
|
435
|
577 |
|
483
|
578 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
579 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
580 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
581 |
return find_torrent(m_ses, m_chk, m_info_hash)->download_limit();
|
|
582 |
}
|
|
583 |
|
|
584 |
@@ -219,7 +218,7 @@
|
|
585 |
INVARIANT_CHECK;
|
|
586 |
|
|
587 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
588 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
589 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
590 |
find_torrent(m_ses, m_chk, m_info_hash)->move_storage(save_path);
|
|
591 |
}
|
|
592 |
|
|
593 |
@@ -228,7 +227,7 @@
|
|
594 |
INVARIANT_CHECK;
|
|
595 |
|
|
596 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
597 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
598 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
599 |
return find_torrent(m_ses, m_chk, m_info_hash)->valid_metadata();
|
|
600 |
}
|
|
601 |
|
|
602 |
@@ -237,7 +236,7 @@
|
|
603 |
INVARIANT_CHECK;
|
|
604 |
|
|
605 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
606 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
607 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
608 |
return find_torrent(m_ses, m_chk, m_info_hash)->is_seed();
|
|
609 |
}
|
|
610 |
|
|
611 |
@@ -246,7 +245,7 @@
|
|
612 |
INVARIANT_CHECK;
|
|
613 |
|
|
614 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
615 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
616 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
617 |
return find_torrent(m_ses, m_chk, m_info_hash)->is_paused();
|
|
618 |
}
|
|
619 |
|
|
620 |
@@ -255,7 +254,7 @@
|
|
621 |
INVARIANT_CHECK;
|
|
622 |
|
|
623 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
624 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
625 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
626 |
find_torrent(m_ses, m_chk, m_info_hash)->pause();
|
|
627 |
}
|
|
628 |
|
|
629 |
@@ -264,7 +263,7 @@
|
|
630 |
INVARIANT_CHECK;
|
|
631 |
|
|
632 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
633 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
634 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
635 |
find_torrent(m_ses, m_chk, m_info_hash)->resume();
|
|
636 |
}
|
|
637 |
|
|
638 |
@@ -274,7 +273,7 @@
|
|
639 |
INVARIANT_CHECK;
|
|
640 |
|
|
641 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
642 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
643 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
644 |
find_torrent(m_ses, m_chk, m_info_hash)->set_tracker_login(name, password);
|
|
645 |
}
|
|
646 |
|
|
647 |
@@ -286,7 +285,7 @@
|
|
648 |
|
|
649 |
if (m_chk)
|
|
650 |
{
|
|
651 |
- mutex::scoped_lock l(m_chk->m_mutex);
|
|
652 |
+ boost::mutex::scoped_lock l(m_chk->m_mutex);
|
|
653 |
|
|
654 |
aux::piece_checker_data* d = m_chk->find_torrent(m_info_hash);
|
|
655 |
if (d != 0)
|
|
656 |
@@ -320,7 +319,7 @@
|
435
|
657 |
|
|
658 |
if (m_chk)
|
|
659 |
{
|
|
660 |
- mutex::scoped_lock l(m_chk->m_mutex);
|
|
661 |
+ boost::mutex::scoped_lock l(m_chk->m_mutex);
|
|
662 |
|
|
663 |
aux::piece_checker_data* d = m_chk->find_torrent(m_info_hash);
|
|
664 |
if (d != 0)
|
483
|
665 |
@@ -356,7 +355,7 @@
|
|
666 |
{
|
|
667 |
INVARIANT_CHECK;
|
|
668 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
669 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
670 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
671 |
find_torrent(m_ses, m_chk, m_info_hash)->set_sequenced_download_threshold(threshold);
|
|
672 |
}
|
|
673 |
|
|
674 |
@@ -365,7 +364,7 @@
|
|
675 |
INVARIANT_CHECK;
|
|
676 |
|
|
677 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
678 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
679 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
680 |
return find_torrent(m_ses, m_chk, m_info_hash)->name();
|
|
681 |
}
|
|
682 |
|
|
683 |
@@ -375,7 +374,7 @@
|
|
684 |
INVARIANT_CHECK;
|
|
685 |
|
|
686 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
687 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
688 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
689 |
find_torrent(m_ses, m_chk, m_info_hash)->piece_availability(avail);
|
|
690 |
}
|
|
691 |
|
|
692 |
@@ -384,7 +383,7 @@
|
|
693 |
INVARIANT_CHECK;
|
|
694 |
|
|
695 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
696 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
697 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
698 |
find_torrent(m_ses, m_chk, m_info_hash)->set_piece_priority(index, priority);
|
|
699 |
}
|
|
700 |
|
|
701 |
@@ -393,7 +392,7 @@
|
|
702 |
INVARIANT_CHECK;
|
|
703 |
|
|
704 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
705 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
706 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
707 |
return find_torrent(m_ses, m_chk, m_info_hash)->piece_priority(index);
|
|
708 |
}
|
|
709 |
|
|
710 |
@@ -402,7 +401,7 @@
|
|
711 |
INVARIANT_CHECK;
|
|
712 |
|
|
713 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
714 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
715 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
716 |
find_torrent(m_ses, m_chk, m_info_hash)->prioritize_pieces(pieces);
|
|
717 |
}
|
|
718 |
|
|
719 |
@@ -411,7 +410,7 @@
|
|
720 |
INVARIANT_CHECK;
|
|
721 |
std::vector<int> ret;
|
|
722 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
723 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
724 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
725 |
find_torrent(m_ses, m_chk, m_info_hash)->piece_priorities(ret);
|
|
726 |
return ret;
|
|
727 |
}
|
|
728 |
@@ -421,7 +420,7 @@
|
|
729 |
INVARIANT_CHECK;
|
|
730 |
|
|
731 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
732 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
733 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
734 |
find_torrent(m_ses, m_chk, m_info_hash)->prioritize_files(files);
|
|
735 |
}
|
|
736 |
|
|
737 |
@@ -431,7 +430,7 @@
|
|
738 |
{
|
|
739 |
INVARIANT_CHECK;
|
|
740 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
741 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
742 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
743 |
find_torrent(m_ses, m_chk, m_info_hash)->filter_piece(index, filter);
|
|
744 |
}
|
435
|
745 |
|
483
|
746 |
@@ -439,7 +438,7 @@
|
|
747 |
{
|
|
748 |
INVARIANT_CHECK;
|
|
749 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
750 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
751 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
752 |
find_torrent(m_ses, m_chk, m_info_hash)->filter_pieces(pieces);
|
|
753 |
}
|
|
754 |
|
|
755 |
@@ -447,7 +446,7 @@
|
|
756 |
{
|
|
757 |
INVARIANT_CHECK;
|
|
758 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
759 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
760 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
761 |
return find_torrent(m_ses, m_chk, m_info_hash)->is_piece_filtered(index);
|
|
762 |
}
|
|
763 |
|
|
764 |
@@ -456,7 +455,7 @@
|
|
765 |
INVARIANT_CHECK;
|
|
766 |
std::vector<bool> ret;
|
|
767 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
768 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
769 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
770 |
find_torrent(m_ses, m_chk, m_info_hash)->filtered_pieces(ret);
|
|
771 |
return ret;
|
|
772 |
}
|
|
773 |
@@ -465,7 +464,7 @@
|
|
774 |
{
|
|
775 |
INVARIANT_CHECK;
|
|
776 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
777 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
778 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
779 |
find_torrent(m_ses, m_chk, m_info_hash)->filter_files(files);
|
|
780 |
}
|
|
781 |
|
|
782 |
@@ -477,7 +476,7 @@
|
|
783 |
INVARIANT_CHECK;
|
|
784 |
|
|
785 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
786 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
787 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
788 |
return find_torrent(m_ses, m_chk, m_info_hash)->trackers();
|
|
789 |
}
|
435
|
790 |
|
483
|
791 |
@@ -486,7 +485,7 @@
|
|
792 |
INVARIANT_CHECK;
|
|
793 |
|
|
794 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
795 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
796 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
797 |
find_torrent(m_ses, m_chk, m_info_hash)->add_url_seed(url);
|
|
798 |
}
|
|
799 |
|
|
800 |
@@ -495,7 +494,7 @@
|
|
801 |
INVARIANT_CHECK;
|
|
802 |
|
|
803 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
804 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
805 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
806 |
find_torrent(m_ses, m_chk, m_info_hash)->remove_url_seed(url);
|
|
807 |
}
|
|
808 |
|
|
809 |
@@ -504,7 +503,7 @@
|
|
810 |
INVARIANT_CHECK;
|
|
811 |
|
|
812 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
813 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
814 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
815 |
return find_torrent(m_ses, m_chk, m_info_hash)->url_seeds();
|
|
816 |
}
|
|
817 |
|
|
818 |
@@ -514,7 +513,7 @@
|
|
819 |
INVARIANT_CHECK;
|
|
820 |
|
|
821 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
822 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
823 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
824 |
find_torrent(m_ses, m_chk, m_info_hash)->replace_trackers(urls);
|
|
825 |
}
|
|
826 |
|
|
827 |
@@ -522,7 +521,7 @@
|
|
828 |
{
|
|
829 |
INVARIANT_CHECK;
|
|
830 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
831 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
832 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
833 |
boost::shared_ptr<torrent> t = find_torrent(m_ses, m_chk, m_info_hash);
|
|
834 |
if (!t->valid_metadata()) throw_invalid_handle();
|
|
835 |
return t->torrent_file();
|
|
836 |
@@ -536,7 +535,7 @@
|
435
|
837 |
|
|
838 |
if (m_chk)
|
|
839 |
{
|
|
840 |
- mutex::scoped_lock l(m_chk->m_mutex);
|
|
841 |
+ boost::mutex::scoped_lock l(m_chk->m_mutex);
|
|
842 |
aux::piece_checker_data* d = m_chk->find_torrent(m_info_hash);
|
|
843 |
if (d != 0) return true;
|
|
844 |
}
|
483
|
845 |
@@ -675,7 +674,7 @@
|
|
846 |
INVARIANT_CHECK;
|
|
847 |
|
|
848 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
849 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
850 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
851 |
return find_torrent(m_ses, m_chk, m_info_hash)->save_path();
|
|
852 |
}
|
|
853 |
|
|
854 |
@@ -693,7 +692,7 @@
|
435
|
855 |
// the torrent is being checked. Add the peer to its
|
|
856 |
// peer list. The entries in there will be connected
|
|
857 |
// once the checking is complete.
|
|
858 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
859 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
860 |
|
|
861 |
aux::piece_checker_data* d = m_chk->find_torrent(m_info_hash);
|
|
862 |
if (d == 0) throw_invalid_handle();
|
483
|
863 |
@@ -744,7 +743,7 @@
|
|
864 |
ratio = 1.f;
|
|
865 |
|
|
866 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
867 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
868 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
869 |
find_torrent(m_ses, m_chk, m_info_hash)->set_ratio(ratio);
|
|
870 |
}
|
|
871 |
|
|
872 |
@@ -753,7 +752,7 @@
|
|
873 |
{
|
|
874 |
INVARIANT_CHECK;
|
|
875 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
876 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
877 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
878 |
find_torrent(m_ses, m_chk, m_info_hash)->resolve_countries(r);
|
|
879 |
}
|
|
880 |
|
|
881 |
@@ -761,7 +760,7 @@
|
|
882 |
{
|
|
883 |
INVARIANT_CHECK;
|
|
884 |
session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
|
|
885 |
- mutex::scoped_lock l2(m_chk->m_mutex);
|
|
886 |
+ boost::mutex::scoped_lock l2(m_chk->m_mutex);
|
|
887 |
return find_torrent(m_ses, m_chk, m_info_hash)->resolving_countries();
|
|
888 |
}
|
|
889 |
#endif
|
|
890 |
diff -ru deluge-0.5.5.orig/libtorrent/src/udp_tracker_connection.cpp deluge-0.5.5/libtorrent/src/udp_tracker_connection.cpp
|
|
891 |
--- deluge-0.5.5.orig/libtorrent/src/udp_tracker_connection.cpp 2007年 9月 3日 一 03:14:45
|
|
892 |
+++ deluge-0.5.5/libtorrent/src/udp_tracker_connection.cpp 2007年 9月 17日 一 00:49:37
|
|
893 |
@@ -175,7 +175,7 @@
|
|
894 |
char* ptr = send_buf;
|
|
895 |
|
|
896 |
if (m_transaction_id == 0)
|
|
897 |
- m_transaction_id = rand() ^ (rand() << 16);
|
|
898 |
+ m_transaction_id = std::rand() ^ (std::rand() << 16);
|
|
899 |
|
|
900 |
// connection_id
|
|
901 |
detail::write_uint32(0x417, ptr);
|
|
902 |
@@ -279,7 +279,7 @@
|
|
903 |
void udp_tracker_connection::send_udp_announce()
|
|
904 |
{
|
|
905 |
if (m_transaction_id == 0)
|
|
906 |
- m_transaction_id = rand() ^ (rand() << 16);
|
|
907 |
+ m_transaction_id = std::rand() ^ (std::rand() << 16);
|
|
908 |
|
|
909 |
if (!m_socket) return; // the operation was aborted
|
|
910 |
|
|
911 |
@@ -338,7 +338,7 @@
|
|
912 |
void udp_tracker_connection::send_udp_scrape()
|
|
913 |
{
|
|
914 |
if (m_transaction_id == 0)
|
|
915 |
- m_transaction_id = rand() ^ (rand() << 16);
|
|
916 |
+ m_transaction_id = std::rand() ^ (std::rand() << 16);
|
|
917 |
|
|
918 |
if (!m_socket) return; // the operation was aborted
|
|
919 |
|
|
920 |
diff -ru deluge-0.5.5.orig/libtorrent/src/upnp.cpp deluge-0.5.5/libtorrent/src/upnp.cpp
|
|
921 |
--- deluge-0.5.5.orig/libtorrent/src/upnp.cpp 2007年 9月 17日 一 01:06:32
|
|
922 |
+++ deluge-0.5.5/libtorrent/src/upnp.cpp 2007年 9月 17日 一 00:49:37
|
435
|
923 |
@@ -618,7 +618,7 @@
|
|
924 |
if (type == xml_start_tag)
|
|
925 |
{
|
|
926 |
if ((!state.top_tag.empty() && state.top_tag == "service")
|
|
927 |
- || !strcmp(string, "service"))
|
|
928 |
+ || !std::strcmp(string, "service"))
|
|
929 |
{
|
|
930 |
state.top_tag = string;
|
|
931 |
}
|
|
932 |
@@ -625,7 +625,7 @@
|
|
933 |
}
|
|
934 |
else if (type == xml_end_tag)
|
|
935 |
{
|
|
936 |
- if (!strcmp(string, "service"))
|
|
937 |
+ if (!std::strcmp(string, "service"))
|
|
938 |
{
|
|
939 |
state.top_tag.clear();
|
|
940 |
if (state.found_service) state.exit = true;
|
|
941 |
@@ -637,7 +637,7 @@
|
|
942 |
{
|
|
943 |
if (state.top_tag == "serviceType")
|
|
944 |
{
|
|
945 |
- if (!strcmp(string, state.service_type))
|
|
946 |
+ if (!std::strcmp(string, state.service_type))
|
|
947 |
state.found_service = true;
|
|
948 |
}
|
|
949 |
else if (state.top_tag == "controlURL")
|
|
950 |
@@ -752,7 +752,7 @@
|
|
951 |
void find_error_code(int type, char const* string, error_code_parse_state& state)
|
|
952 |
{
|
|
953 |
if (state.exit) return;
|
|
954 |
- if (type == xml_start_tag && !strcmp("errorCode", string))
|
|
955 |
+ if (type == xml_start_tag && !std::strcmp("errorCode", string))
|
|
956 |
{
|
|
957 |
state.in_error_code = true;
|
|
958 |
}
|
483
|
959 |
diff -ru deluge-0.5.5.orig/libtorrent/src/kademlia/node.cpp deluge-0.5.5/libtorrent/src/kademlia/node.cpp
|
|
960 |
--- deluge-0.5.5.orig/libtorrent/src/kademlia/node.cpp 2007年 9月 17日 一 01:06:32
|
|
961 |
+++ deluge-0.5.5/libtorrent/src/kademlia/node.cpp 2007年 9月 17日 一 00:49:37
|
|
962 |
@@ -420,7 +420,7 @@
|
|
963 |
int num = (std::min)((int)v.peers.size(), m_settings.max_peers_reply);
|
|
964 |
peers.clear();
|
|
965 |
peers.reserve(num);
|
|
966 |
- random_sample_n(boost::make_transform_iterator(v.peers.begin(), &get_endpoint)
|
|
967 |
+ std::random_sample_n(boost::make_transform_iterator(v.peers.begin(), &get_endpoint)
|
|
968 |
, boost::make_transform_iterator(v.peers.end(), &get_endpoint)
|
|
969 |
, std::back_inserter(peers), num);
|
435
|
970 |
|
483
|
971 |
diff -ru deluge-0.5.5.orig/libtorrent/src/kademlia/rpc_manager.cpp deluge-0.5.5/libtorrent/src/kademlia/rpc_manager.cpp
|
|
972 |
--- deluge-0.5.5.orig/libtorrent/src/kademlia/rpc_manager.cpp 2007年 9月 17日 一 01:06:06
|
|
973 |
+++ deluge-0.5.5/libtorrent/src/kademlia/rpc_manager.cpp 2007年 9月 17日 一 00:49:37
|
435
|
974 |
@@ -82,7 +82,7 @@
|
|
975 |
if (--o->m_refs == 0)
|
|
976 |
{
|
|
977 |
boost::pool<>& p = o->pool_allocator;
|
|
978 |
- o->~observer();
|
|
979 |
+ (const_cast<observer*>(o))->~observer();
|
|
980 |
p.ordered_free(const_cast<observer*>(o));
|
|
981 |
}
|
|
982 |
}
|
|
983 |
@@ -106,7 +106,7 @@
|
|
984 |
rpc_manager::rpc_manager(fun const& f, node_id const& our_id
|
|
985 |
, routing_table& table, send_fun const& sf)
|
|
986 |
: m_pool_allocator(sizeof(mpl::deref<max_observer_type_iter::base>::type))
|
|
987 |
- , m_next_transaction_id(rand() % max_transactions)
|
|
988 |
+ , m_next_transaction_id(std::rand() % max_transactions)
|
|
989 |
, m_oldest_transaction_id(m_next_transaction_id)
|
|
990 |
, m_incoming(f)
|
|
991 |
, m_send(sf)
|