patches/deluge-01-sunpro.diff
author jurikm
Sun, 12 Feb 2012 14:04:10 +0000
changeset 8245 383896da4129
parent 1402 4b8e841da99c
permissions -rw-r--r--
SFEsauerbraten.spec: add IPS package name
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
     1
--- deluge-torrent-0.5.9.1-orig/setup.py	2008-05-19 01:44:59.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
     2
+++ deluge-torrent-0.5.9.1/setup.py	2008-06-19 16:36:05.997302854 +0000
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
     3
@@ -98,12 +98,12 @@
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     4
 #    it has been removed to prevent confusion.
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     5
 
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     6
 if not OS == "win":
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     7
-    EXTRA_COMPILE_ARGS = ["-Wno-missing-braces", 
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     8
+    EXTRA_COMPILE_ARGS = [
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     9
                 "-DHAVE_INCLUDE_LIBTORRENT_ASIO____ASIO_HPP=1", 
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    10
                 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_SSL_STREAM_HPP=1", 
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    11
                 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_IP_TCP_HPP=1", 
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    12
                 "-DHAVE_PTHREAD=1", "-DTORRENT_USE_OPENSSL=1", "-DHAVE_SSL=1", 
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    13
-                "-DNDEBUG=1", "-O2"]
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    14
+                "-DNDEBUG=1"]
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    15
     if ARCH == "x64":
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    16
         EXTRA_COMPILE_ARGS.append("-DAMD64")
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    17
 
1011
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
    18
@@ -150,10 +150,10 @@
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    19
     librariestype = [boost_filesystem, boost_date_time,
1011
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
    20
             boost_thread, 'z', 'pthread', 'ssl', 'crypto']
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
    21
 
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
    22
-    if os == "linux":
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
    23
+    if OS == "nix" or OS == "linux":
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
    24
         librariestype += ['rt']
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    25
     
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    26
-    removals = ['-g', '-Wstrict-prototypes']
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    27
+    removals = ['-g', '-Wstrict-prototypes', '-OPT:Olimit=0']
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    28
 
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    29
     if python_version == '2.5':
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    30
         cv_opt = sysconfig.get_config_vars()["CFLAGS"]
1011
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
    31
@@ -165,6 +165,10 @@
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    32
         for removal in removals:
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    33
             cv_opt = cv_opt.replace(removal, " ")
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    34
         sysconfig.get_config_vars()["OPT"] = ' '.join(cv_opt.split())
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    35
+    cv_opt = sysconfig.get_config_vars()["BASECFLAGS"]
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    36
+    for removal in removals:
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    37
+        cv_opt = cv_opt.replace(removal, " ")
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    38
+    sysconfig.get_config_vars()["BASECFLAGS"] = ' '.join(cv_opt.split())
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    39
 else:
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    40
     EXTRA_COMPILE_ARGS = [  '-O2', '-DBOOST_WINDOWS',
937
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
    41
                             '-fno-strict-aliasing',
1011
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
    42
@@ -215,7 +219,8 @@
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    43
                     libraries = librariestype,
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    44
                     extra_compile_args = EXTRA_COMPILE_ARGS,
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    45
                     extra_link_args = EXTRA_LINK_ARGS,
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    46
-                    sources = sources)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    47
+                    sources = sources,
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    48
+                    language = 'c++')
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    49
 
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    50
 # Thanks to Iain Nicol for code to save the location for installed prefix
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    51
 # At runtime, we need to know where we installed the data to.
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
    52
--- deluge-torrent-0.5.9.1-orig/libtorrent/include/libtorrent/xml_parse.hpp	2008-05-11 23:55:17.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
    53
+++ deluge-torrent-0.5.9.1/libtorrent/include/libtorrent/xml_parse.hpp	2008-06-19 16:36:05.997593489 +0000
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
    54
@@ -128,7 +128,7 @@
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
    55
 				*(p-1) = '?';
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
    56
 				tag_end = p - 1;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
    57
 			}
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
    58
-			else if (start + 5 < p && memcmp(start, "!--", 3) == 0 && memcmp(p-2, "--", 2) == 0)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
    59
+			else if (start + 5 < p && std::memcmp(start, "!--", 3) == 0 && std::memcmp(p-2, "--", 2) == 0)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
    60
 			{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
    61
 				start += 3;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
    62
 				*(p-2) = 0;
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
    63
--- deluge-torrent-0.5.9.1-orig/libtorrent/include/libtorrent/asio/detail/socket_ops.hpp	2008-05-11 23:55:17.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
    64
+++ deluge-torrent-0.5.9.1/libtorrent/include/libtorrent/asio/detail/socket_ops.hpp	2008-06-19 16:36:05.998558743 +0000
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    65
@@ -197,7 +197,10 @@
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    66
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    67
   b.buf = static_cast<char*>(data);
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    68
   b.len = static_cast<u_long>(size);
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    69
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    70
+#elif defined(__SUNPRO_CC)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    71
+  b.iov_base = static_cast<char*>(data);
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    72
+  b.iov_len = size;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    73
+#else // defined(__SUNPRO_CC)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    74
   b.iov_base = data;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    75
   b.iov_len = size;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    76
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    77
@@ -208,7 +211,10 @@
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    78
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    79
   b.buf = static_cast<char*>(const_cast<void*>(data));
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    80
   b.len = static_cast<u_long>(size);
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    81
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    82
+#elif defined(__SUNPRO_CC)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    83
+  b.iov_base = static_cast<char*>(const_cast<void*>(data));
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    84
+  b.iov_len = size;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    85
+#else // defined(__SUNPRO_CC)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    86
   b.iov_base = const_cast<void*>(data);
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    87
   b.iov_len = size;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    88
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
    89
--- deluge-torrent-0.5.9.1-orig/libtorrent/include/libtorrent/asio/impl/error_code.ipp	2008-05-11 23:55:16.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
    90
+++ deluge-torrent-0.5.9.1/libtorrent/include/libtorrent/asio/impl/error_code.ipp	2008-06-19 16:36:05.998828118 +0000
937
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
    91
@@ -83,16 +83,16 @@
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    92
   if (category() != error::get_system_category())
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    93
     return "asio error";
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    94
 #if defined(__sun) || defined(__QNX__)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    95
-  return strerror(value_);
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    96
+  return std::strerror(value_);
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    97
 #elif defined(__MACH__) && defined(__APPLE__) \
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    98
 || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
    99
 || defined(_AIX) || defined(__hpux) || defined(__osf__)
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   100
   char buf[256] = "";
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   101
-  strerror_r(value_, buf, sizeof(buf));
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   102
+  std::strerror_r(value_, buf, sizeof(buf));
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   103
   return buf;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   104
 #else
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   105
   char buf[256] = "";
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   106
-  return strerror_r(value_, buf, sizeof(buf));
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   107
+  std::return strerror_r(value_, buf, sizeof(buf));
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   108
 #endif
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   109
 #endif // defined(BOOST_WINDOWS)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   110
 }
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   111
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/http_stream.cpp	2008-05-18 22:12:25.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   112
+++ deluge-torrent-0.5.9.1/libtorrent/src/http_stream.cpp	2008-06-19 16:36:05.999064910 +0000
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   113
@@ -130,7 +130,7 @@
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   114
 		if (found_end)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   115
 		{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   116
 			m_buffer.push_back(0);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   117
-			char* status = strchr(&m_buffer[0], ' ');
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   118
+			char* status = std::strchr(&m_buffer[0], ' ');
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   119
 			if (status == 0)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   120
 			{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   121
 				(*h)(asio::error::operation_not_supported);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   122
@@ -139,7 +139,7 @@
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   123
 			}
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   124
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   125
 			status++;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   126
-			int code = atoi(status);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   127
+			int code = std::atoi(status);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   128
 			if (code != 200)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   129
 			{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   130
 				(*h)(asio::error::operation_not_supported);
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   131
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/piece_picker.cpp	2008-05-18 22:12:25.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   132
+++ deluge-torrent-0.5.9.1/libtorrent/src/piece_picker.cpp	2008-06-19 16:36:05.999930124 +0000
937
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   133
@@ -536,7 +536,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   134
 		{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   135
 			// find a random position in the destination vector where we will place
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   136
 			// this entry.
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   137
-			int dst_index = rand() % m_piece_info[priority].size();
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   138
+			int dst_index = std::rand() % m_piece_info[priority].size();
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   139
 			
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   140
 			// copy the entry at that position to the back
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   141
 			m_piece_map[m_piece_info[priority][dst_index]].index
937
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   142
@@ -608,7 +608,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   143
 		{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   144
 			// find a random position in the destination vector where we will place
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   145
 			// this entry.
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   146
-			int dst_index = rand() % m_piece_info[new_priority].size();
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   147
+			int dst_index = std::rand() % m_piece_info[new_priority].size();
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   148
 			
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   149
 			// copy the entry at that position to the back
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   150
 			m_piece_map[m_piece_info[new_priority][dst_index]].index
937
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   151
@@ -1189,7 +1189,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   152
 			// we're not using rarest first (only for the first
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   153
 			// bucket, since that's where the currently downloading
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   154
 			// pieces are)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   155
-			int start_piece = rand() % m_piece_map.size();
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   156
+			int start_piece = std::rand() % m_piece_map.size();
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   157
 
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   158
 			// if we have suggested pieces, try to find one of those instead
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   159
 			for (std::vector<int>::const_iterator i = suggested_pieces.begin()
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   160
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/session.cpp	2008-05-18 22:12:25.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   161
+++ deluge-torrent-0.5.9.1/libtorrent/src/session.cpp	2008-06-19 16:36:06.004093093 +0000
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   162
@@ -77,7 +77,6 @@
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   163
 using boost::shared_ptr;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   164
 using boost::weak_ptr;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   165
 using boost::bind;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   166
-using boost::mutex;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   167
 using libtorrent::aux::session_impl;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   168
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   169
 namespace libtorrent
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   170
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/session_impl.cpp	2008-05-18 22:37:11.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   171
+++ deluge-torrent-0.5.9.1/libtorrent/src/session_impl.cpp	2008-06-19 16:36:06.005696187 +0000
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   172
@@ -98,7 +98,6 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   173
 using boost::shared_ptr;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   174
 using boost::weak_ptr;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   175
 using boost::bind;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   176
-using boost::mutex;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   177
 using libtorrent::aux::session_impl;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   178
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   179
 namespace libtorrent {
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   180
@@ -208,7 +207,7 @@
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   181
 #endif
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   182
 					}
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   183
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   184
-					mutex::scoped_lock l2(m_mutex);
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   185
+                                        boost::mutex::scoped_lock l2(m_mutex);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   186
 
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   187
 					if (m_torrents.empty() || m_torrents.front() != t)
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   188
 					{
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   189
@@ -296,7 +295,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   190
 				// This will happen if the storage fails to initialize
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   191
 				// for example if one of the files has an invalid filename.
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   192
 				session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   193
-				mutex::scoped_lock l2(m_mutex);
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   194
+                                boost::mutex::scoped_lock l2(m_mutex);
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   195
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   196
 				if (m_ses.m_alerts.should_post(alert::fatal))
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   197
 				{
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   198
@@ -315,7 +314,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   199
 #ifndef NDEBUG
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   200
 				std::cerr << "error while checking resume data\n";
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   201
 #endif
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   202
-				mutex::scoped_lock l(m_mutex);
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   203
+                                boost::mutex::scoped_lock l(m_mutex);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   204
 				TORRENT_ASSERT(!m_torrents.empty());
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   205
 				m_torrents.pop_front();
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   206
 				TORRENT_ASSERT(false);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   207
@@ -332,7 +331,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   208
 				boost::tie(finished, progress) = processing->torrent_ptr->check_files();
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   209
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   210
 				{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   211
-					mutex::scoped_lock l2(m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   212
+					boost::mutex::scoped_lock l2(m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   213
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   214
 					INVARIANT_CHECK;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   215
 
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   216
@@ -362,7 +361,7 @@
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   217
 				{
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   218
 					// lock the session to add the new torrent
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   219
 					session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   220
-					mutex::scoped_lock l2(m_mutex);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   221
+                                        boost::mutex::scoped_lock l2(m_mutex);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   222
 
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   223
 					INVARIANT_CHECK;
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   224
 
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   225
@@ -425,7 +424,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   226
 			{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   227
 				// This will happen if the storage fails to initialize
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   228
 				session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   229
-				mutex::scoped_lock l2(m_mutex);
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   230
+                                boost::mutex::scoped_lock l2(m_mutex);
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   231
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   232
 				if (m_ses.m_alerts.should_post(alert::fatal))
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   233
 				{
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   234
@@ -452,7 +451,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   235
 #ifndef NDEBUG
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   236
 				std::cerr << "error while checking files\n";
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   237
 #endif
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   238
-				mutex::scoped_lock l(m_mutex);
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   239
+                                boost::mutex::scoped_lock l(m_mutex);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   240
 				TORRENT_ASSERT(!m_processing.empty());
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   241
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   242
 				processing.reset();
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   243
@@ -764,7 +763,7 @@
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   244
 		m_download_channel.close();
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   245
 		m_upload_channel.close();
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   246
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   247
-		mutex::scoped_lock l2(m_checker_impl.m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   248
+		boost::mutex::scoped_lock l2(m_checker_impl.m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   249
 		// abort the checker thread
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   250
 		m_checker_impl.m_abort = true;
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   251
 
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   252
@@ -1669,7 +1668,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   253
 	std::vector<torrent_handle> session_impl::get_torrents()
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   254
 	{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   255
 		mutex_t::scoped_lock l(m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   256
-		mutex::scoped_lock l2(m_checker_impl.m_mutex);
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   257
+                boost::mutex::scoped_lock l2(m_checker_impl.m_mutex);
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   258
 		std::vector<torrent_handle> ret;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   259
 		for (std::deque<boost::shared_ptr<aux::piece_checker_data> >::iterator i
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   260
 			= m_checker_impl.m_torrents.begin()
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   261
@@ -1721,7 +1720,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   262
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   263
 		// lock the session and the checker thread (the order is important!)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   264
 		mutex_t::scoped_lock l(m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   265
-		mutex::scoped_lock l2(m_checker_impl.m_mutex);
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   266
+                boost::mutex::scoped_lock l2(m_checker_impl.m_mutex);
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   267
 
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   268
 //		INVARIANT_CHECK;
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   269
 
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   270
@@ -1797,7 +1796,7 @@
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   271
 		TORRENT_ASSERT(!save_path.empty());
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   272
 		{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   273
 			// lock the checker_thread
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   274
-			mutex::scoped_lock l(m_checker_impl.m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   275
+			boost::mutex::scoped_lock l(m_checker_impl.m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   276
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   277
 			// is the torrent currently being checked?
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   278
 			if (m_checker_impl.find_torrent(info_hash))
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   279
@@ -1896,7 +1895,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   280
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   281
 		if (h.m_chk)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   282
 		{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   283
-			mutex::scoped_lock l(m_checker_impl.m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   284
+			boost::mutex::scoped_lock l(m_checker_impl.m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   285
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   286
 			aux::piece_checker_data* d = m_checker_impl.find_torrent(h.m_info_hash);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   287
 			if (d != 0)
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   288
@@ -2208,7 +2207,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   289
 		// destructed and then the invariant will be broken).
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   290
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   291
 		{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   292
-			mutex::scoped_lock l(m_checker_impl.m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   293
+			boost::mutex::scoped_lock l(m_checker_impl.m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   294
 			// abort the checker thread
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   295
 			m_checker_impl.m_abort = true;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   296
 
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   297
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/sha1.cpp	2008-05-18 22:12:25.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   298
+++ deluge-torrent-0.5.9.1/libtorrent/src/sha1.cpp	2008-06-19 16:36:06.006271345 +0000
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   299
@@ -20,20 +20,19 @@
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   300
 // #include <stdint.h>
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   301
 
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   302
 #include <boost/cstdint.hpp>
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   303
-using boost::uint32_t;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   304
 using boost::uint8_t;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   305
 
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   306
 #include "libtorrent/config.hpp"
442
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   307
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   308
 struct TORRENT_EXPORT SHA_CTX
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   309
 {
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   310
-	uint32_t state[5];
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   311
-	uint32_t count[2];
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   312
+	boost::uint32_t state[5];
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   313
+	boost::uint32_t count[2];
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   314
 	uint8_t buffer[64];
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   315
 };
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   316
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   317
 TORRENT_EXPORT void SHA1_Init(SHA_CTX* context);
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   318
-TORRENT_EXPORT void SHA1_Update(SHA_CTX* context, uint8_t const* data, uint32_t len);
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   319
+TORRENT_EXPORT void SHA1_Update(SHA_CTX* context, uint8_t const* data, boost::uint32_t len);
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   320
 TORRENT_EXPORT void SHA1_Final(uint8_t* digest, SHA_CTX* context);
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   321
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   322
 namespace
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   323
@@ -41,7 +40,7 @@
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   324
 	union CHAR64LONG16
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   325
 	{
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   326
 		uint8_t c[64];
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   327
-		uint32_t l[16];
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   328
+		boost::uint32_t l[16];
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   329
 	};
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   330
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   331
 #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   332
@@ -50,7 +49,7 @@
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   333
 // I got the idea of expanding during the round function from SSLeay
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   334
 	struct little_endian_blk0
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   335
 	{
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   336
-		static uint32_t apply(CHAR64LONG16* block, int i)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   337
+		static boost::uint32_t apply(CHAR64LONG16* block, int i)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   338
 		{
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   339
 			return block->l[i] = (rol(block->l[i],24)&0xFF00FF00)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   340
 				| (rol(block->l[i],8)&0x00FF00FF);
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   341
@@ -59,7 +58,7 @@
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   342
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   343
 	struct big_endian_blk0
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   344
 	{
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   345
-		static uint32_t apply(CHAR64LONG16* block, int i)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   346
+		static boost::uint32_t apply(CHAR64LONG16* block, int i)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   347
 		{
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   348
 			return  block->l[i];
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   349
 		}
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   350
@@ -78,10 +77,10 @@
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   351
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   352
 	// Hash a single 512-bit block. This is the core of the algorithm.
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   353
 	template <class BlkFun>
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   354
-	void SHA1Transform(uint32_t state[5], uint8_t const buffer[64])
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   355
+	void SHA1Transform(boost::uint32_t state[5], uint8_t const buffer[64])
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   356
 	{
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   357
 		using namespace std;
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   358
-		uint32_t a, b, c, d, e;
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   359
+		boost::uint32_t a, b, c, d, e;
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   360
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   361
 		CHAR64LONG16* block;
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   362
 		uint8_t workspace[64];
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   363
@@ -136,10 +135,10 @@
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   364
 	}
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   365
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   366
 	template <class BlkFun>
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   367
-	void internal_update(SHA_CTX* context, uint8_t const* data, uint32_t len)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   368
+	void internal_update(SHA_CTX* context, uint8_t const* data, boost::uint32_t len)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   369
 	{
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   370
 		using namespace std;
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   371
-		uint32_t i, j;	// JHB
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   372
+		boost::uint32_t i, j;	// JHB
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   373
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   374
 #ifdef VERBOSE
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   375
 		SHAPrintContext(context, "before");
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   376
@@ -169,7 +168,7 @@
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   377
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   378
 	bool is_big_endian()
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   379
 	{
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   380
-		uint32_t test = 1;
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   381
+		boost::uint32_t test = 1;
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   382
 		return *reinterpret_cast<uint8_t*>(&test) == 0;
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   383
 	}
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   384
 }
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   385
@@ -190,7 +189,7 @@
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   386
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   387
 // Run your data through this.
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   388
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   389
-void SHA1_Update(SHA_CTX* context, uint8_t const* data, uint32_t len)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   390
+void SHA1_Update(SHA_CTX* context, uint8_t const* data, boost::uint32_t len)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   391
 {
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   392
 #if defined __BIG_ENDIAN__
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   393
 	internal_update<big_endian_blk0>(context, data, len);
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   394
@@ -213,7 +212,7 @@
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   395
 {
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   396
 	uint8_t finalcount[8];
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   397
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   398
-	for (uint32_t i = 0; i < 8; ++i)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   399
+	for (boost::uint32_t i = 0; i < 8; ++i)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   400
 	{
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   401
 		// Endian independent
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   402
 		finalcount[i] = static_cast<uint8_t>(
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   403
@@ -226,7 +225,7 @@
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   404
 		SHA1_Update(context, (uint8_t const*)"\0", 1);
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   405
 	SHA1_Update(context, finalcount, 8);  // Should cause a SHA1Transform()
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   406
 
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   407
-	for (uint32_t i = 0; i < 20; ++i)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   408
+	for (boost::uint32_t i = 0; i < 20; ++i)
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   409
 	{
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   410
 		digest[i] = static_cast<unsigned char>(
db9a15a1f103 2007-09-01 Albert Lee <[email protected]>
trisk
parents: 435
diff changeset
   411
 			(context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   412
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/torrent.cpp	2008-05-18 22:37:11.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   413
+++ deluge-torrent-0.5.9.1/libtorrent/src/torrent.cpp	2008-06-19 16:36:06.007867564 +0000
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   414
@@ -79,7 +79,6 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   415
 using boost::tuples::get;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   416
 using boost::tuples::make_tuple;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   417
 using boost::bind;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   418
-using boost::mutex;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   419
 using libtorrent::aux::session_impl;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   420
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   421
 namespace
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   422
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/torrent_handle.cpp	2008-05-18 22:12:25.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   423
+++ deluge-torrent-0.5.9.1/libtorrent/src/torrent_handle.cpp	2008-06-19 16:39:15.955003859 +0000
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   424
@@ -75,7 +75,6 @@
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   425
 #endif
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   426
 
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   427
 using boost::bind;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   428
-using boost::mutex;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   429
 using libtorrent::aux::session_impl;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   430
 
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   431
 #ifdef BOOST_NO_EXCEPTIONS
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   432
@@ -84,7 +83,7 @@
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   433
 	if (m_ses == 0) return; \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   434
 	TORRENT_ASSERT(m_chk); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   435
 	session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   436
-	mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   437
+	boost::mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   438
 	torrent* t = find_torrent(m_ses, m_chk, m_info_hash); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   439
 	if (t == 0) return; \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   440
 	t->call
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   441
@@ -93,7 +92,7 @@
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   442
 	if (m_ses == 0) return def; \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   443
 	TORRENT_ASSERT(m_chk); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   444
 	session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   445
-	mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   446
+	boost::mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   447
 	torrent* t = find_torrent(m_ses, m_chk, m_info_hash); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   448
 	if (t == 0) return def; \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   449
 	return t->call
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   450
@@ -102,7 +101,7 @@
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   451
 	if (m_ses == 0) return def; \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   452
 	TORRENT_ASSERT(m_chk); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   453
 	session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   454
-	mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   455
+	boost::mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   456
 	torrent* t = find_torrent(m_ses, m_chk, m_info_hash); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   457
 	if (t == 0) return def; \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   458
 	t->call
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   459
@@ -113,7 +112,7 @@
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   460
 	if (m_ses == 0) throw_invalid_handle(); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   461
 	TORRENT_ASSERT(m_chk); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   462
 	session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   463
-	mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   464
+	boost::mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   465
 	torrent* t = find_torrent(m_ses, m_chk, m_info_hash); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   466
 	if (t == 0) throw_invalid_handle(); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   467
 	t->call
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   468
@@ -122,7 +121,7 @@
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   469
 	if (m_ses == 0) throw_invalid_handle(); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   470
 	TORRENT_ASSERT(m_chk); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   471
 	session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   472
-	mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   473
+	boost::mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   474
 	torrent* t = find_torrent(m_ses, m_chk, m_info_hash); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   475
 	if (t == 0) return def; \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   476
 	return t->call
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   477
@@ -131,7 +130,7 @@
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   478
 	if (m_ses == 0) throw_invalid_handle(); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   479
 	TORRENT_ASSERT(m_chk); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   480
 	session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   481
-	mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   482
+	boost::mutex::scoped_lock l2(m_chk->m_mutex); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   483
 	torrent* t = find_torrent(m_ses, m_chk, m_info_hash); \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   484
 	if (t == 0) return def; \
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   485
 	t->call
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   486
@@ -311,7 +310,7 @@
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   487
 		TORRENT_ASSERT(m_chk);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   488
 	
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   489
 		session_impl::mutex_t::scoped_lock l(m_ses->m_mutex);
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   490
-		mutex::scoped_lock l2(m_chk->m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   491
+		boost::mutex::scoped_lock l2(m_chk->m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   492
 
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   493
 		aux::piece_checker_data* d = m_chk->find_torrent(m_info_hash);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   494
 		if (d != 0)
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   495
@@ -472,7 +471,7 @@
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   496
 #endif
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   497
 		TORRENT_ASSERT(m_chk);
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   498
 		session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   499
-		mutex::scoped_lock l2(m_chk->m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   500
+		boost::mutex::scoped_lock l2(m_chk->m_mutex);
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   501
 		torrent* t = find_torrent(m_ses, m_chk, m_info_hash);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   502
 		if (t == 0 || !t->valid_metadata())
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   503
 #ifdef BOOST_NO_EXCEPTIONS
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   504
@@ -489,7 +488,7 @@
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   505
 		if (m_ses == 0) return false;
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   506
 		TORRENT_ASSERT(m_chk);
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   507
 		session_impl::mutex_t::scoped_lock l1(m_ses->m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   508
-		mutex::scoped_lock l2(m_chk->m_mutex);
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   509
+                boost::mutex::scoped_lock l2(m_chk->m_mutex);
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   510
 		torrent* t = find_torrent(m_ses, m_chk, m_info_hash);
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   511
 		return t != 0;
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   512
 	}
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   513
@@ -507,7 +506,7 @@
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   514
 		TORRENT_ASSERT(m_chk);
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   515
 
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   516
 		session_impl::mutex_t::scoped_lock l(m_ses->m_mutex);
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   517
-		mutex::scoped_lock l2(m_chk->m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   518
+		boost::mutex::scoped_lock l2(m_chk->m_mutex);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   519
 
937
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   520
 		torrent* t = find_torrent(m_ses, m_chk, m_info_hash);
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   521
 		if (!t || !t->valid_metadata())
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   522
@@ -670,7 +669,7 @@
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   523
 			// the torrent is being checked. Add the peer to its
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   524
 			// peer list. The entries in there will be connected
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   525
 			// once the checking is complete.
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   526
-			mutex::scoped_lock l2(m_chk->m_mutex);
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   527
+			boost::mutex::scoped_lock l2(m_chk->m_mutex);
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   528
 
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   529
 			aux::piece_checker_data* d = m_chk->find_torrent(m_info_hash);
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   530
 			if (d == 0)
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   531
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/udp_tracker_connection.cpp	2008-05-18 22:12:25.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   532
+++ deluge-torrent-0.5.9.1/libtorrent/src/udp_tracker_connection.cpp	2008-06-19 16:36:06.009208730 +0000
937
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   533
@@ -187,7 +187,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   534
 		char* ptr = send_buf;
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   535
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   536
 		if (m_transaction_id == 0)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   537
-			m_transaction_id = rand() ^ (rand() << 16);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   538
+			m_transaction_id = std::rand() ^ (std::rand() << 16);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   539
 
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   540
 		// connection_id
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   541
 		detail::write_uint32(0x417, ptr);
937
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   542
@@ -292,7 +292,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   543
 	void udp_tracker_connection::send_udp_announce()
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   544
 	{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   545
 		if (m_transaction_id == 0)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   546
-			m_transaction_id = rand() ^ (rand() << 16);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   547
+			m_transaction_id = std::rand() ^ (std::rand() << 16);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   548
 
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   549
 		if (!m_socket.is_open()) return; // the operation was aborted
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   550
 
937
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   551
@@ -352,7 +352,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   552
 	void udp_tracker_connection::send_udp_scrape()
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   553
 	{
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   554
 		if (m_transaction_id == 0)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   555
-			m_transaction_id = rand() ^ (rand() << 16);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   556
+			m_transaction_id = std::rand() ^ (std::rand() << 16);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   557
 
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   558
 		if (!m_socket.is_open()) return; // the operation was aborted
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   559
 
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   560
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/upnp.cpp	2008-05-18 22:36:37.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   561
+++ deluge-torrent-0.5.9.1/libtorrent/src/upnp.cpp	2008-06-19 16:36:06.009774227 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   562
@@ -642,14 +642,14 @@
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   563
 		if (type == xml_start_tag)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   564
 		{
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   565
 			if ((!state.top_tag.empty() && state.top_tag == "service")
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   566
-				|| !strcmp(string, "service"))
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   567
+				|| !std::strcmp(string, "service"))
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   568
 			{
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   569
 				state.top_tag = string;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   570
 			}
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   571
 		}
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   572
 		else if (type == xml_end_tag)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   573
 		{
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   574
-			if (!strcmp(string, "service"))
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   575
+			if (!std::strcmp(string, "service"))
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   576
 			{
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   577
 				state.top_tag.clear();
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   578
 				if (state.found_service) state.exit = true;
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   579
@@ -661,7 +661,7 @@
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   580
 		{
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   581
 			if (state.top_tag == "serviceType")
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   582
 			{
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   583
-				if (!strcmp(string, state.service_type))
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   584
+				if (!std::strcmp(string, state.service_type))
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   585
 					state.found_service = true;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   586
 			}
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   587
 			else if (state.top_tag == "controlURL")
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   588
@@ -783,7 +783,7 @@
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   589
 	void find_error_code(int type, char const* string, error_code_parse_state& state)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   590
 	{
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   591
 		if (state.exit) return;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   592
-		if (type == xml_start_tag && !strcmp("errorCode", string))
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   593
+		if (type == xml_start_tag && !std::strcmp("errorCode", string))
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   594
 		{
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   595
 			state.in_error_code = true;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   596
 		}
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   597
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/kademlia/node.cpp	2008-05-18 22:12:22.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   598
+++ deluge-torrent-0.5.9.1/libtorrent/src/kademlia/node.cpp	2008-06-19 16:36:06.010181163 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   599
@@ -428,7 +428,7 @@
483
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   600
 	int num = (std::min)((int)v.peers.size(), m_settings.max_peers_reply);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   601
 	peers.clear();
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   602
 	peers.reserve(num);
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   603
-	random_sample_n(boost::make_transform_iterator(v.peers.begin(), &get_endpoint)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   604
+	std::random_sample_n(boost::make_transform_iterator(v.peers.begin(), &get_endpoint)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   605
 		, boost::make_transform_iterator(v.peers.end(), &get_endpoint)
d6732d35da1e 2007-09-17 Albert Lee <[email protected]>
trisk
parents: 442
diff changeset
   606
 		, std::back_inserter(peers), num);
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   607
 
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   608
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/kademlia/rpc_manager.cpp	2008-05-18 22:12:22.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   609
+++ deluge-torrent-0.5.9.1/libtorrent/src/kademlia/rpc_manager.cpp	2008-06-19 16:36:06.010485270 +0000
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   610
@@ -82,7 +82,7 @@
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   611
 	if (--o->m_refs == 0)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   612
 	{
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   613
 		boost::pool<>& p = o->pool_allocator;
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   614
-		o->~observer();
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   615
+		(const_cast<observer*>(o))->~observer();
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   616
 		p.free(const_cast<observer*>(o));
435
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   617
 	}
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   618
 }
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   619
@@ -106,7 +106,7 @@
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   620
 rpc_manager::rpc_manager(fun const& f, node_id const& our_id
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   621
 	, routing_table& table, send_fun const& sf)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   622
 	: m_pool_allocator(sizeof(mpl::deref<max_observer_type_iter::base>::type))
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   623
-	, m_next_transaction_id(rand() % max_transactions)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   624
+	, m_next_transaction_id(std::rand() % max_transactions)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   625
 	, m_oldest_transaction_id(m_next_transaction_id)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   626
 	, m_incoming(f)
d7bd3f2702af 2007-08-31 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   627
 	, m_send(sf)
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   628
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/web_peer_connection.cpp	2008-05-18 22:12:25.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   629
+++ deluge-torrent-0.5.9.1/libtorrent/src/web_peer_connection.cpp	2008-06-19 16:36:06.010826061 +0000
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   630
@@ -467,7 +467,7 @@
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   631
 			else
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   632
 			{
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   633
 				range_start = 0;
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   634
-				range_end = atol(m_parser.header("content-length").c_str());
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   635
+				range_end = std::atol(m_parser.header("content-length").c_str());
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   636
 				if (range_end == -1)
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   637
 				{
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   638
 					// we should not try this server again.
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   639
--- deluge-torrent-0.5.9.1-orig/libtorrent/include/libtorrent/asio/detail/resolver_service.hpp	2008-05-11 23:55:17.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   640
+++ deluge-torrent-0.5.9.1/libtorrent/include/libtorrent/asio/detail/resolver_service.hpp	2008-06-19 16:36:06.011108335 +0000
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   641
@@ -329,7 +329,7 @@
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   642
   void start_work_thread()
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   643
   {
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   644
     asio::detail::mutex::scoped_lock lock(mutex_);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   645
-    if (work_thread_ == 0)
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   646
+    if (work_thread_.get() == 0)
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   647
     {
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   648
       work_thread_.reset(new asio::detail::thread(
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   649
             work_io_service_runner(*work_io_service_)));
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   650
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/lsd.cpp	2008-05-18 22:12:25.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   651
+++ deluge-torrent-0.5.9.1/libtorrent/src/lsd.cpp	2008-06-19 16:36:06.011324195 +0000
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   652
@@ -166,7 +166,7 @@
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   653
 	sha1_hash ih(0);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   654
 	std::istringstream ih_sstr(ih_str);
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   655
 	ih_sstr >> ih;
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   656
-	int port = atoi(port_str.c_str());
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   657
+	int port = std::atoi(port_str.c_str());
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   658
 
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   659
 	if (!ih.is_all_zeros() && port != 0)
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   660
 	{
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   661
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/http_tracker_connection.cpp	2008-05-18 22:12:25.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   662
+++ deluge-torrent-0.5.9.1/libtorrent/src/http_tracker_connection.cpp	2008-06-19 16:36:06.011841503 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   663
@@ -705,7 +705,7 @@
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   664
 
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   665
 		if (m_parser.header_finished())
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   666
 		{
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   667
-			int cl = atoi(m_parser.header("content-length").c_str());
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   668
+			int cl = std::atoi(m_parser.header("content-length").c_str());
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   669
 			if (cl > m_settings.tracker_maximum_response_length)
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   670
 			{
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   671
 				fail(-1, "content-length is greater than maximum response length");
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   672
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/enum_net.cpp	2008-05-18 22:12:25.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   673
+++ deluge-torrent-0.5.9.1/libtorrent/src/enum_net.cpp	2008-06-19 16:36:06.012071925 +0000
1011
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
   674
@@ -31,6 +31,7 @@
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
   675
 */
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   676
 
1011
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
   677
 #include "libtorrent/config.hpp"
751
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   678
+#include "asio/ip/host_name.hpp"
52b9e1fac36a 2007-12-31 Mark Wright <[email protected]>
markwright
parents: 483
diff changeset
   679
 
1011
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
   680
 #if defined TORRENT_BSD || defined TORRENT_LINUX
ba657f63d907 2008-03-26 Albert Lee <[email protected]>
trisk
parents: 937
diff changeset
   681
 #include <sys/ioctl.h>
1402
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   682
--- deluge-torrent-0.5.9.1-orig/libtorrent/src/identify_client.cpp	2008-05-18 22:12:25.000000000 +0000
4b8e841da99c * SFEdeluge.spec, patches/deluge-01-sunpro.diff: Bump to 0.5.9.1, bump patch1
markwright
parents: 1011
diff changeset
   683
+++ deluge-torrent-0.5.9.1/libtorrent/src/identify_client.cpp	2008-06-19 16:36:06.012336233 +0000
937
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   684
@@ -34,6 +34,7 @@
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   685
 
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   686
 #include <cctype>
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   687
 #include <algorithm>
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   688
+#include <stdio.h>
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   689
 
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   690
 #ifdef _MSC_VER
83221d86c5f4 2008-02-26 Mark Wright <[email protected]>
markwright
parents: 751
diff changeset
   691
 #pragma warning(push, 1)