patches/rtorrent-04-sunpro.diff
author jurikm
Sun, 12 Feb 2012 14:04:10 +0000
changeset 8245 383896da4129
parent 1263 74f1e78b1e06
permissions -rw-r--r--
SFEsauerbraten.spec: add IPS package name
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     1
--- rtorrent-0.8.2.orig/rak/string_manip.h	2008-05-07 08:19:12.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     2
+++ rtorrent-0.8.2/rak/string_manip.h	2008-06-25 02:14:10.028329996 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     3
@@ -62,7 +62,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     4
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     5
 template <typename Sequence>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     6
 Sequence trim_end(const Sequence& seq) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     7
-  if (seq.empty() || !std::isspace(*(--seq.end())))
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     8
+  if (seq.empty() || !std::isspace(*(seq.end()-1)))
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
     9
     return seq;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    10
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    11
   typename Sequence::size_type pos = seq.size();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    12
@@ -93,7 +93,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    13
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    14
 template <typename Sequence>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    15
 Sequence trim_end_classic(const Sequence& seq) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    16
-  if (seq.empty() || !std::isspace(*(--seq.end()), std::locale::classic()))
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    17
+  if (seq.empty() || !std::isspace(*(seq.end()-1), std::locale::classic()))
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    18
     return seq;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    19
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    20
   typename Sequence::size_type pos = seq.size();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    21
--- rtorrent-0.8.2.orig/rak/path.h	2008-05-07 08:19:12.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    22
+++ rtorrent-0.8.2/rak/path.h	2008-06-25 01:57:52.656513911 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    23
@@ -42,6 +42,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    24
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    25
 #include <cstdlib>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    26
 #include <string>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    27
+#include <algorithm>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    28
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    29
 namespace rak {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    30
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    31
@@ -91,7 +92,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    32
     if (home == NULL)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    33
       return first;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    34
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    35
-    first += strlcpy(first, home, std::distance(first, last));
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    36
+    first += strlcpy(first, home, last-first);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    37
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    38
     if (first > last)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    39
       return last;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    40
@@ -99,7 +100,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    41
     src++;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    42
   }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    43
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    44
-  return std::min(first + strlcpy(first, src, std::distance(first, last)), last);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    45
+  return std::min(first + strlcpy(first, src, last-first), last);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    46
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    47
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    48
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    49
--- rtorrent-0.8.2.orig/rak/unordered_vector.h	2008-05-07 08:19:12.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    50
+++ rtorrent-0.8.2/rak/unordered_vector.h	2008-06-25 02:29:35.381434005 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    51
@@ -90,7 +90,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    52
 unordered_vector<_Tp>::insert(iterator position, const value_type& x) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    53
   Base::push_back(x);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    54
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    55
-  return --end();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    56
+  return end()-1;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    57
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    58
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    59
 template <typename _Tp>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    60
--- rtorrent-0.8.2.orig/rak/socket_address.h	2008-05-07 08:19:12.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    61
+++ rtorrent-0.8.2/rak/socket_address.h	2008-06-25 01:58:48.126132462 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    62
@@ -50,6 +50,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    63
 #include <cstring>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    64
 #include <string>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    65
 #include <stdexcept>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    66
+#include <algorithm>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    67
 #include <arpa/inet.h>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    68
 #include <netinet/in.h>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    69
 #include <sys/types.h>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    70
--- rtorrent-0.8.2.orig/rak/regex.h	2008-05-07 08:19:12.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    71
+++ rtorrent-0.8.2/rak/regex.h	2008-06-25 02:10:05.332867456 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    72
@@ -75,7 +75,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    73
   std::list<unsigned int> paths;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    74
   paths.push_front(0);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    75
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    76
-  for (std::string::const_iterator itrText = ++text.begin(), lastText = text.end(); itrText != lastText; ++itrText) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    77
+  for (std::string::const_iterator itrText = text.begin()+1, lastText = text.end(); itrText != lastText; ++itrText) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    78
     
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    79
     for (std::list<unsigned int>::iterator itrPaths = paths.begin(), lastPaths = paths.end(); itrPaths != lastPaths; ) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    80
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    81
--- rtorrent-0.8.2.orig/rak/algorithm.h	2008-05-07 08:19:12.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    82
+++ rtorrent-0.8.2/rak/algorithm.h	2008-06-25 17:27:39.728352000 -0400
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
    83
@@ -40,6 +40,63 @@
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    84
 #include <algorithm>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    85
 #include <functional>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    86
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    87
+#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    88
+namespace std {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    89
+  template <class Iterator> struct iterator_traits
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    90
+  {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    91
+    typedef typename Iterator::value_type value_type;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    92
+    typedef typename Iterator::difference_type difference_type;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    93
+    typedef typename Iterator::pointer pointer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    94
+    typedef typename Iterator::reference reference;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    95
+    typedef typename Iterator::iterator_category iterator_category;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    96
+  };
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    97
+  template <class T> struct iterator_traits<T*>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    98
+  {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
    99
+    typedef T value_type;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   100
+    typedef ptrdiff_t difference_type;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   101
+    typedef T* pointer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   102
+    typedef T& reference;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   103
+    typedef random_access_iterator_tag iterator_category;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   104
+  };
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   105
+  template <class T> struct iterator_traits<const T*>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   106
+  {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   107
+    typedef T value_type;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   108
+    typedef ptrdiff_t difference_type;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   109
+    typedef const T* pointer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   110
+    typedef const T& reference;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   111
+    typedef random_access_iterator_tag iterator_category;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   112
+  };
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   113
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   114
+  template <class ForwardIterator>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   115
+  inline typename iterator_traits<ForwardIterator>::difference_type
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   116
+  distance (ForwardIterator first, ForwardIterator last)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   117
+  {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   118
+    typename iterator_traits<ForwardIterator>::difference_type n = 0;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   119
+    __distance(first, last, n, 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   120
+               iterator_traits<ForwardIterator>::iterator_category());
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   121
+    return n;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   122
+  }
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   123
+
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   124
+  template <class InputIterator, class T>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   125
+  inline typename iterator_traits<InputIterator>::difference_type
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   126
+  count (InputIterator first, InputIterator last, const T& value)
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   127
+  {
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   128
+    typename iterator_traits<InputIterator>::difference_type n = 0;
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   129
+    count(first, last, value, n);
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   130
+    return n;
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   131
+  }
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   132
+
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   133
+  template <class InputIterator, class Predicate>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   134
+  inline typename iterator_traits<InputIterator>::difference_type
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   135
+  count_if (InputIterator first, InputIterator last, Predicate pred)
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   136
+  {
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   137
+    typename iterator_traits<InputIterator>::difference_type n = 0;
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   138
+    count_if(first, last, pred, n);
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   139
+    return n;
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   140
+  }
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   141
+}
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   142
+#endif
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   143
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   144
 namespace rak {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   145
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   146
 template <typename _InputIter, typename _Function>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   147
--- rtorrent-0.8.2.orig/src/command_file.cc	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   148
+++ rtorrent-0.8.2/src/command_file.cc	2008-06-25 18:06:51.985365949 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   149
@@ -64,7 +64,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   150
   torrent::Object resultRaw(*file->path()->begin());
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   151
   torrent::Object::string_type& result = resultRaw.as_string();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   152
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   153
-  for (torrent::Path::const_iterator itr = ++file->path()->begin(), last = file->path()->end(); itr != last; itr++)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   154
+  for (torrent::Path::const_iterator itr = (file->path()->begin())+1, last = file->path()->end(); itr != last; itr++)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   155
     result += '/' + *itr;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   156
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   157
   return resultRaw;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   158
--- rtorrent-0.8.2.orig/src/display/window_download_list.cc	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   159
+++ rtorrent-0.8.2/src/display/window_download_list.cc	2008-06-25 03:05:03.087916943 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   160
@@ -90,9 +90,9 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   161
     ++range.second;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   162
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   163
   int pos = 1;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   164
+  char* buffer = new char[m_canvas->width() + 1];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   165
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   166
   while (range.first != range.second) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   167
-    char buffer[m_canvas->width() + 1];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   168
     char* position;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   169
     char* last = buffer + m_canvas->width() - 2 + 1;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   170
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   171
@@ -107,6 +107,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   172
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   173
     ++range.first;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   174
   }    
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   175
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   176
+  delete buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   177
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   178
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   179
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   180
--- rtorrent-0.8.2.orig/src/display/window_text.cc	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   181
+++ rtorrent-0.8.2/src/display/window_text.cc	2008-06-25 03:18:19.930779231 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   182
@@ -93,8 +93,9 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   183
   if (m_canvas->height() == 0)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   184
     return;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   185
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   186
+  char* buffer = new char[m_canvas->width() + 1];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   187
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   188
   if (m_errorHandler != NULL && m_target.second == NULL) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   189
-    char buffer[m_canvas->width() + 1];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   190
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   191
     Canvas::attributes_list attributes;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   192
     attributes.push_back(Attributes(buffer, Attributes::a_normal, Attributes::color_default));
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   193
@@ -102,6 +103,9 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   194
     char* last = m_errorHandler->print(buffer, buffer + m_canvas->width(), &attributes, m_target);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   195
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   196
     m_canvas->print_attributes(0, position, buffer, last, &attributes);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   197
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   198
+    delete buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   199
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   200
     return;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   201
   }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   202
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   203
@@ -109,8 +113,6 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   204
     if (*itr == NULL)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   205
       continue;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   206
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   207
-    char buffer[m_canvas->width() + 1];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   208
-
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   209
     Canvas::attributes_list attributes;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   210
     attributes.push_back(Attributes(buffer, Attributes::a_normal, Attributes::color_default));
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   211
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   212
@@ -118,6 +120,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   213
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   214
     m_canvas->print_attributes(0, position, buffer, last, &attributes);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   215
   }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   216
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   217
+  delete buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   218
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   219
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   220
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   221
--- rtorrent-0.8.2.orig/src/display/frame.h	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   222
+++ rtorrent-0.8.2/src/display/frame.h	2008-06-25 02:47:06.518734587 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   223
@@ -92,9 +92,9 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   224
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   225
   Window*             window() const                    { return m_window; }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   226
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   227
-  Frame*              frame(size_type idx)              { return m_container[idx]; }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   228
+  Frame*              frame(size_type idx)              { return m_container.frames[idx]; }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   229
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   230
-  size_type           container_size() const            { return m_containerSize; }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   231
+  size_type           container_size() const            { return m_container.size; }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   232
   void                set_container_size(size_type size);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   233
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   234
   void                initialize_window(Window* window);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   235
@@ -120,13 +120,14 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   236
   uint32_t            m_width;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   237
   uint32_t            m_height;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   238
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   239
+  typedef struct {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   240
+    size_type           size;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   241
+    Frame*              frames[max_size];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   242
+  } container_t;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   243
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   244
   union {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   245
     Window*             m_window;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   246
-    
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   247
-    struct {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   248
-      size_type           m_containerSize;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   249
-      Frame*              m_container[max_size];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   250
-    };
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   251
+    container_t         m_container;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   252
   };
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   253
 };
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   254
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   255
--- rtorrent-0.8.2.orig/src/display/text_element_string.cc	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   256
+++ rtorrent-0.8.2/src/display/text_element_string.cc	2008-06-25 02:57:08.521853302 -0400
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   257
@@ -36,6 +36,7 @@
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   258
 
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   259
 #include "config.h"
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   260
 
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   261
+#include <rak/algorithm.h>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   262
 #include <rak/string_manip.h>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   263
 
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   264
 #include "rpc/parse_commands.h"
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   265
@@ -52,17 +52,21 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   266
     return first;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   267
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   268
   if (m_flags & flag_escape_hex) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   269
-    char buffer[last - first];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   270
+    char* buffer = new char[last - first];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   271
     char* bufferLast = copy_string(buffer, buffer + (last - first), target);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   272
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   273
     first = rak::transform_hex(buffer, bufferLast, first, last);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   274
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   275
+    delete buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   276
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   277
   } else if (m_flags & flag_escape_html) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   278
-    char buffer[last - first];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   279
+    char* buffer = new char[last - first];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   280
     char* bufferLast = copy_string(buffer, buffer + (last - first), target);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   281
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   282
     first = rak::copy_escape_html(buffer, bufferLast, first, last);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   283
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   284
+    delete buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   285
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   286
   } else {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   287
     first = copy_string(first, last, target);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   288
   }  
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   289
--- rtorrent-0.8.2.orig/src/display/window.h	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   290
+++ rtorrent-0.8.2/src/display/window.h	2008-06-26 00:42:49.975992333 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   291
@@ -41,6 +41,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   292
 #include <rak/functional.h>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   293
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   294
 #include "canvas.h"
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   295
+#include "manager.h"
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   296
 #include "globals.h"
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   297
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   298
 namespace display {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   299
--- rtorrent-0.8.2.orig/src/display/window_statusbar.cc	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   300
+++ rtorrent-0.8.2/src/display/window_statusbar.cc	2008-06-25 03:15:15.445557476 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   301
@@ -53,7 +53,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   302
   m_canvas->erase();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   303
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   304
   // TODO: Make a buffer with size = get_width?
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   305
-  char buffer[m_canvas->width() + 1];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   306
+  char* buffer = new char[m_canvas->width() + 1];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   307
   char* position;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   308
   char* last = buffer + m_canvas->width();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   309
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   310
@@ -68,6 +68,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   311
   }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   312
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   313
   m_lastTick = control->tick();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   314
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   315
+  delete buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   316
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   317
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   318
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   319
--- rtorrent-0.8.2.orig/src/display/window_file_list.cc	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   320
+++ rtorrent-0.8.2/src/display/window_file_list.cc	2008-06-25 03:08:33.655012018 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   321
@@ -84,7 +84,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   322
   if (fl->size_files() == 0 || m_canvas->height() < 2)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   323
     return;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   324
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   325
-  iterator entries[m_canvas->height() - 1];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   326
+  iterator* entries = new iterator[m_canvas->height() - 1];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   327
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   328
   unsigned int last = 0;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   329
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   330
@@ -134,7 +134,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   331
       m_canvas->print(16 + itr.depth() - 1, pos, "/");
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   332
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   333
     } else if (itr.is_file()) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   334
-      char buffer[std::max<unsigned int>(m_canvas->width() + 1, 256)];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   335
+      char* buffer = new char[std::max<unsigned int>(m_canvas->width() + 1, 256)];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   336
       Canvas::attributes_list attributes;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   337
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   338
       torrent::File* e = *itr;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   339
@@ -169,6 +169,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   340
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   341
       m_canvas->print_attributes(0, pos, buffer, buffer + std::strlen(buffer), &attributes);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   342
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   343
+      delete buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   344
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   345
     } else {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   346
       m_canvas->print(0, pos, "BORK BORK");
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   347
     }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   348
@@ -179,6 +181,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   349
     pos++;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   350
     first = (first + 1) % (m_canvas->height() - 1);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   351
   }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   352
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   353
+  delete entries;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   354
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   355
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   356
 int
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   357
--- rtorrent-0.8.2.orig/src/display/window_log.cc	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   358
+++ rtorrent-0.8.2/src/display/window_log.cc	2008-06-25 03:13:37.195603865 -0400
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   359
@@ -37,6 +37,7 @@
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   360
 #include "config.h"
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   361
 
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   362
 #include <ctime>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   363
+#include <rak/algorithm.h>
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   364
 
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   365
 #include "canvas.h"
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   366
 #include "utils.h"
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   367
--- rtorrent-0.8.2.orig/src/display/frame.cc	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   368
+++ rtorrent-0.8.2/src/display/frame.cc	2008-06-25 02:51:41.636803977 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   369
@@ -41,6 +41,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   370
 #include <rak/algorithm.h>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   371
 #include <torrent/exceptions.h>
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   372
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   373
+#include "manager.h"
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   374
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   375
 #include "frame.h"
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   376
 #include "window.h"
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   377
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   378
@@ -63,8 +65,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   379
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   380
   case TYPE_ROW:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   381
   case TYPE_COLUMN:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   382
-    for (size_type i = 0; i < m_containerSize; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   383
-      if (m_container[i]->is_width_dynamic())
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   384
+    for (size_type i = 0; i < m_container.size; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   385
+      if (m_container.frames[i]->is_width_dynamic())
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   386
         return true;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   387
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   388
     return false;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   389
@@ -81,8 +83,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   390
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   391
   case TYPE_ROW:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   392
   case TYPE_COLUMN:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   393
-    for (size_type i = 0; i < m_containerSize; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   394
-      if (m_container[i]->is_height_dynamic())
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   395
+    for (size_type i = 0; i < m_container.size; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   396
+      if (m_container.frames[i]->is_height_dynamic())
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   397
         return true;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   398
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   399
     return false;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   400
@@ -99,8 +101,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   401
   case TYPE_WINDOW: return m_window->is_active() && m_window->is_left();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   402
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   403
   case TYPE_COLUMN:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   404
-    for (size_type i = 0; i < m_containerSize; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   405
-      if (m_container[i]->has_left_frame())
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   406
+    for (size_type i = 0; i < m_container.size; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   407
+      if (m_container.frames[i]->has_left_frame())
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   408
         return true;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   409
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   410
     return false;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   411
@@ -117,8 +119,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   412
   case TYPE_WINDOW: return m_window->is_active() && m_window->is_bottom();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   413
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   414
   case TYPE_ROW:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   415
-    for (size_type i = 0; i < m_containerSize; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   416
-      if (m_container[i]->has_bottom_frame())
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   417
+    for (size_type i = 0; i < m_container.size; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   418
+      if (m_container.frames[i]->has_bottom_frame())
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   419
         return true;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   420
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   421
     return false;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   422
@@ -145,8 +147,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   423
     {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   424
       bounds_type accum(0, 0, 0, 0);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   425
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   426
-      for (size_type i = 0; i < m_containerSize; ++i) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   427
-        bounds_type p = m_container[i]->preferred_size();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   428
+      for (size_type i = 0; i < m_container.size; ++i) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   429
+        bounds_type p = m_container.frames[i]->preferred_size();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   430
  
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   431
         accum.minWidth += p.minWidth;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   432
         accum.minHeight += p.minHeight;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   433
@@ -174,13 +176,13 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   434
   if ((m_type != TYPE_ROW && m_type != TYPE_COLUMN) || size >= max_size)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   435
     throw torrent::internal_error("Frame::set_container_size(...) Bad state.");
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   436
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   437
-  while (m_containerSize > size) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   438
-    delete m_container[--m_containerSize];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   439
-    m_container[m_containerSize] = NULL;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   440
+  while (m_container.size > size) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   441
+    delete m_container.frames[--m_container.size];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   442
+    m_container.frames[m_container.size] = NULL;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   443
   }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   444
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   445
-  while (m_containerSize < size) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   446
-    m_container[m_containerSize++] = new Frame();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   447
+  while (m_container.size < size) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   448
+    m_container.frames[m_container.size++] = new Frame();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   449
   }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   450
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   451
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   452
@@ -202,10 +204,10 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   453
     throw torrent::internal_error("Frame::initialize_container(...) size >= max_size.");
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   454
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   455
   m_type = TYPE_ROW;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   456
-  m_containerSize = size;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   457
+  m_container.size = size;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   458
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   459
-  for (size_type i = 0; i < m_containerSize; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   460
-    m_container[i] = new Frame();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   461
+  for (size_type i = 0; i < m_container.size; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   462
+    m_container.frames[i] = new Frame();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   463
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   464
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   465
 void
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   466
@@ -217,10 +219,10 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   467
     throw torrent::internal_error("Frame::initialize_container(...) size >= max_size.");
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   468
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   469
   m_type = TYPE_COLUMN;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   470
-  m_containerSize = size;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   471
+  m_container.size = size;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   472
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   473
-  for (size_type i = 0; i < m_containerSize; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   474
-    m_container[i] = new Frame();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   475
+  for (size_type i = 0; i < m_container.size; ++i)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   476
+    m_container.frames[i] = new Frame();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   477
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   478
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   479
 void
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   480
@@ -234,9 +236,9 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   481
     
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   482
   case TYPE_ROW:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   483
   case TYPE_COLUMN:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   484
-    for (size_type i = 0; i < m_containerSize; ++i) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   485
-      m_container[i]->clear();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   486
-      delete m_container[i];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   487
+    for (size_type i = 0; i < m_container.size; ++i) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   488
+      m_container.frames[i]->clear();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   489
+      delete m_container.frames[i];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   490
     }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   491
     break;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   492
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   493
@@ -261,7 +263,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   494
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   495
   case TYPE_ROW:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   496
   case TYPE_COLUMN:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   497
-    for (Frame **itr = m_container, **last = m_container + m_containerSize; itr != last; ++itr)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   498
+    for (Frame **itr = m_container.frames, **last = m_container.frames + m_container.size; itr != last; ++itr)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   499
       (*itr)->refresh();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   500
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   501
     break;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   502
@@ -282,7 +284,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   503
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   504
   case TYPE_ROW:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   505
   case TYPE_COLUMN:
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   506
-    for (Frame **itr = m_container, **last = m_container + m_containerSize; itr != last; ++itr)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   507
+    for (Frame **itr = m_container.frames, **last = m_container.frames + m_container.size; itr != last; ++itr)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   508
       (*itr)->redraw();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   509
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   510
     break;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   511
@@ -343,7 +345,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   512
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   513
   int remaining = height;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   514
   
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   515
-  for (Frame **itr = m_container, **last = m_container + m_containerSize; itr != last; ++itr) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   516
+  for (Frame **itr = m_container.frames, **last = m_container.frames + m_container.size; itr != last; ++itr) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   517
     bounds_type bounds = (*itr)->preferred_size();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   518
     
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   519
     if ((*itr)->is_height_dynamic()) {
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   520
@@ -391,7 +393,7 @@
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   521
   // the frame is too small, it will set the remaining windows to zero
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   522
   // extent which will flag them as offscreen.
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   523
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   524
-  for (Frame **itr = m_container, **last = m_container + m_containerSize; itr != last; ++itr) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   525
+  for (Frame **itr = m_container.frames, **last = m_container.frames + m_container.size; itr != last; ++itr) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   526
     // If there is any remaining space, check if we want to shift
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   527
     // the subsequent frames to the other side of this frame.
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   528
     if (remaining > 0 && (*itr)->has_bottom_frame()) {
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   529
@@ -417,7 +419,7 @@
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   530
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   531
   int remaining = width;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   532
   
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   533
-  for (Frame **itr = m_container, **last = m_container + m_containerSize; itr != last; ++itr) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   534
+  for (Frame **itr = m_container.frames, **last = m_container.frames + m_container.size; itr != last; ++itr) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   535
     bounds_type bounds = (*itr)->preferred_size();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   536
     
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   537
     if ((*itr)->is_width_dynamic()) {
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   538
@@ -465,7 +469,7 @@
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   539
   // the frame is too small, it will set the remaining windows to zero
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   540
   // extent which will flag them as offscreen.
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   541
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   542
-  for (Frame **itr = m_container, **last = m_container + m_containerSize; itr != last; ++itr) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   543
+  for (Frame **itr = m_container.frames, **last = m_container.frames + m_container.size; itr != last; ++itr) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   544
     // If there is any remaining space, check if we want to shift
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   545
     // the subsequent frames to the other side of this frame.
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   546
     if (remaining > 0 && (*itr)->has_left_frame()) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   547
--- rtorrent-0.8.2.orig/src/display/window_download_statusbar.cc	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   548
+++ rtorrent-0.8.2/src/display/window_download_statusbar.cc	2008-06-25 03:05:11.110750771 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   549
@@ -61,7 +61,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   550
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   551
   m_canvas->erase();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   552
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   553
-  char buffer[m_canvas->width()];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   554
+  char* buffer = new char[m_canvas->width()];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   555
   char* position;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   556
   char* last = buffer + m_canvas->width() - 2;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   557
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   558
@@ -88,6 +88,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   559
                   m_download->tracker_list()->has_active() ? 'C' : ' ',
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   560
                   (int)(m_download->download()->tracker_list()->time_next_connection()),
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   561
                   buffer);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   562
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   563
+  delete buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   564
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   565
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   566
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   567
--- rtorrent-0.8.2.orig/src/core/scheduler.cc	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   568
+++ rtorrent-0.8.2/src/core/scheduler.cc	2008-06-25 02:19:20.043037414 -0400
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   569
@@ -37,6 +37,7 @@
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   570
 #include "config.h"
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   571
 
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   572
 #include <algorithm>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   573
+#include <rak/algorithm.h>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   574
 #include <rak/functional.h>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   575
 #include <torrent/exceptions.h>
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   576
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   577
--- rtorrent-0.8.2.orig/src/core/view.cc	2008-05-07 08:19:11.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   578
+++ rtorrent-0.8.2/src/core/view.cc	2008-06-25 02:28:36.651635274 -0400
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   579
@@ -38,6 +38,7 @@
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   580
 
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   581
 #include <algorithm>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   582
 #include <functional>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   583
+#include <rak/algorithm.h>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   584
 #include <rak/functional.h>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   585
 #include <rak/functional_fun.h>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   586
 #include <rpc/parse_commands.h>
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   587
--- rtorrent-0.8.2.orig/src/core/manager.cc	2008-06-25 01:44:38.134154000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   588
+++ rtorrent-0.8.2/src/core/manager.cc	2008-06-25 02:08:43.144712661 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   589
@@ -352,19 +352,25 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   590
   int port;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   591
   rak::address_info* ai;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   592
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   593
-  char buf[addr.length() + 1];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   594
+  char* buf = new char[addr.length() + 1];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   595
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   596
   int err = std::sscanf(addr.c_str(), "%[^:]:%i", buf, &port);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   597
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   598
-  if (err <= 0)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   599
+  if (err <= 0) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   600
+    delete buf;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   601
     throw torrent::input_error("Could not parse proxy address.");
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   602
+  }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   603
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   604
   if (err == 1)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   605
     port = 80;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   606
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   607
-  if ((err = rak::address_info::get_address_info(buf, PF_INET, SOCK_STREAM, &ai)) != 0)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   608
+  if ((err = rak::address_info::get_address_info(buf, PF_INET, SOCK_STREAM, &ai)) != 0) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   609
+    delete buf;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   610
     throw torrent::input_error("Could not set proxy address: " + std::string(rak::address_info::strerror(err)) + ".");
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   611
-  
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   612
+  }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   613
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   614
+  delete buf;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   615
+
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   616
   try {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   617
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   618
     ai->address()->set_port(port);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   619
--- rtorrent-0.8.2.orig/src/rpc/parse.cc	2008-05-07 08:19:10.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   620
+++ rtorrent-0.8.2/src/rpc/parse.cc	2008-06-25 17:30:55.775246860 -0400
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   621
@@ -37,6 +37,7 @@
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   622
 #include "config.h"
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   623
 
1263
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   624
 #include <locale>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   625
+#include <rak/algorithm.h>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   626
 #include <rak/path.h>
74f1e78b1e06 2008-07-04 Albert Lee <[email protected]>
trisk
parents: 1248
diff changeset
   627
 #include <torrent/exceptions.h>
1248
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   628
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   629
--- rtorrent-0.8.2.orig/src/rpc/xmlrpc.cc	2008-05-07 08:19:10.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   630
+++ rtorrent-0.8.2/src/rpc/xmlrpc.cc	2008-06-25 17:54:04.404987582 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   631
@@ -477,7 +477,8 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   632
   xmlrpc_env_init(&localEnv);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   633
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   634
   xmlrpc_registry_add_method_w_doc(&localEnv, (xmlrpc_registry*)m_registry, NULL, name,
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   635
-                                   &xmlrpc_call_command, const_cast<char*>(name), parm, doc);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   636
+                                   (const xmlrpc_method)(&xmlrpc_call_command),
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   637
+				   const_cast<char*>(name), parm, doc);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   638
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   639
   if (localEnv.fault_occurred)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   640
     throw torrent::internal_error("Fault occured while inserting xmlrpc call.");
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   641
--- rtorrent-0.8.2.orig/src/rpc/scgi.cc	2008-06-25 01:44:38.128033000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   642
+++ rtorrent-0.8.2/src/rpc/scgi.cc	2008-06-25 17:32:13.998638901 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   643
@@ -85,7 +85,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   644
   if (filename.empty() || filename.size() > 4096)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   645
     throw torrent::resource_error("Invalid filename length.");
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   646
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   647
-  char buffer[sizeof(sockaddr_un) + filename.size()];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   648
+  char* buffer = new char[sizeof(sockaddr_un) + filename.size()];
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   649
   sockaddr_un* sa = reinterpret_cast<sockaddr_un*>(buffer);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   650
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   651
   sa->sun_family = AF_UNIX;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   652
@@ -96,6 +96,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   653
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   654
   open(sa, offsetof(struct sockaddr_un, sun_path) + filename.size() + 1);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   655
   m_path = filename;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   656
+  delete buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   657
 }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   658
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   659
 void
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   660
--- rtorrent-0.8.2.orig/src/rpc/scgi_task.cc	2008-05-07 08:19:10.000000000 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   661
+++ rtorrent-0.8.2/src/rpc/scgi_task.cc	2008-06-25 17:41:41.493886588 -0400
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   662
@@ -134,7 +134,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   663
     if (current == m_buffer || *current != ':' || headerSize < 17 || headerSize > max_header_size)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   664
       goto event_read_failed;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   665
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   666
-    if (std::distance(++current, m_position) < headerSize + 1)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   667
+    if (m_position - (++current) < headerSize + 1)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   668
       return;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   669
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   670
     if (std::memcmp(current, "CONTENT_LENGTH", 15) != 0)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   671
@@ -147,7 +147,7 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   672
       goto event_read_failed;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   673
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   674
     m_body = current + headerSize + 1;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   675
-    headerSize = std::distance(m_buffer, m_body);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   676
+    headerSize = m_body - m_buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   677
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   678
     if ((unsigned int)(contentSize + headerSize) < m_bufferSize) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   679
       m_bufferSize = contentSize + headerSize;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   680
@@ -155,26 +155,26 @@
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   681
     } else if ((unsigned int)contentSize <= default_buffer_size) {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   682
       m_bufferSize = contentSize;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   683
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   684
-      std::memmove(m_buffer, m_body, std::distance(m_body, m_position));
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   685
-      m_position = m_buffer + std::distance(m_body, m_position);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   686
+      std::memmove(m_buffer, m_body, m_position - m_body);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   687
+      m_position = m_buffer + (m_position - m_body);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   688
       m_body = m_buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   689
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   690
     } else {
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   691
-      realloc_buffer((m_bufferSize = contentSize) + 1, m_body, std::distance(m_body, m_position));
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   692
+      realloc_buffer((m_bufferSize = contentSize) + 1, m_body, m_position - m_body);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   693
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   694
-      m_position = m_buffer + std::distance(m_body, m_position);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   695
+      m_position = m_buffer + (m_position - m_body);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   696
       m_body = m_buffer;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   697
     }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   698
   }
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   699
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   700
-  if ((unsigned int)std::distance(m_buffer, m_position) != m_bufferSize)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   701
+  if ((unsigned int)(m_position - m_buffer) != m_bufferSize)
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   702
     return;
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   703
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   704
   control->poll()->remove_read(this);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   705
   control->poll()->insert_write(this);
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   706
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   707
   // Close if the call failed, else stay open to write back data.
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   708
-  if (!m_parent->receive_call(this, m_body, m_bufferSize - std::distance(m_buffer, m_body)))
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   709
+  if (!m_parent->receive_call(this, m_body, m_bufferSize - (m_body - m_buffer)))
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   710
     close();
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   711
 
9f6e7108cd7f 2008-06-28 Albert Lee <[email protected]>
trisk
parents:
diff changeset
   712
   return;