diff --git a/doc/rtorrent.1.xml b/doc/rtorrent.1.xml
index 0c19802c..bee7a61b 100644
--- a/doc/rtorrent.1.xml
+++ b/doc/rtorrent.1.xml
@@ -221,14 +221,18 @@
i
+
Display chunk rarity.
+
o
- Display the tracker list. Cycle the trackers in a group
+
+Display the tracker list. Cycle the trackers in a group
+
with the space-bar.
@@ -236,29 +240,37 @@ Display chunk rarity.
p
- View peer and torrent information.
+
+View peer and torrent information.
+
t | T
- Initiate tracker request. Use capital T to force the
- request, ignoring the "min interval" set by the tracker.
+
+Initiate tracker request. Use capital T to force the request, ignoring
+the "min interval" set by the tracker.
+
k
+
Disconnect peer.
+
*
+
Choke/Snubb peer.
+
@@ -277,29 +289,37 @@ Choke/Snubb peer.
-b a.b.c.d
- Bind listening socket and outgoing connections to this
- network interface address.
+
+Bind listening socket and outgoing connections to this network
+interface address.
+
-d directory
- Set the default download directory. Defaults to "./".
+
+Set the default download directory. Defaults to "./".
+
-h
- Display help and exit.
+
+Display help and exit.
+
-i a.b.c.d
- Set the address reported to the tracker.
+
+Set the address reported to the tracker.
+
@@ -318,20 +338,23 @@ to allow comma in the option.
-p a-b
- Try to open a listening port in the range
- a up to and including
- b.
+
+Try to open a listening port in the range a up to
+and including b.
+
-s directory
- Session management will be enabled and the torrent files for
- all open downloads will be stored in this directory. Only
- one instance of rtorrent should be used with each session
- directory, though at the moment no locking is done. An empty
- string will disable the session directory.
+
+Session management will be enabled and the torrent files for all open
+downloads will be stored in this directory. Only one instance of
+rtorrent should be used with each session directory, though at the
+moment no locking is done. An empty string will disable the session
+directory.
+
@@ -350,81 +373,101 @@ to allow comma in the option.
max_peers = value
- Set the maximum number of peers to allow in each download.
+
+Set the maximum number of peers to allow in each download.
+
min_peers = value
- Set the minimum number of peers to try to connect to in each
- download.
+
+Set the minimum number of peers to try to connect to in each download.
+
max_uploads = value
- Set the maximum number of simultaneous uploads per download.
+
+Set the maximum number of simultaneous uploads per download.
+
download_rate = KB
- Set the maximum global download rate.
+
+Set the maximum global download rate.
+
upload_rate = KB
- Set the maximum global upload rate.
+
+Set the maximum global upload rate.
+
bind = a.b.c.d
- Bind listening socket and outgoing connections to this
- network interface address.
+
+Bind listening socket and outgoing connections to this network
+interface address.
+
ip = a.b.c.d
- Set the address reported to the tracker.
+
+Set the address reported to the tracker.
+
port_range = a-b
- Try to open a listening port in the range
- a up to and including
- b.
+
+Try to open a listening port in the range a up to
+and including b.
+
port_random = yes | no
- Open the listening port at a random position in the port range.
+
+Open the listening port at a random position in the port range.
+
check_hash = yes | no
- Perform hash check on finished downloads.
+
+Perform hash check on finished downloads.
+
directory = directory
- Set the default download directory. Defaults to "./".
+
+Set the default download directory. Defaults to "./".
+
@@ -432,11 +475,11 @@ to allow comma in the option.
session = directory
- Session management will be enabled and the torrent files for
- all open downloads will be stored in this directory. Only
- one instance of rtorrent should be used with each session
- directory, though at the moment no locking is done. An empty
- string will disable the session directory.
+Session management will be enabled and the torrent files for all open
+downloads will be stored in this directory. Only one instance of
+rtorrent should be used with each session directory, though at the
+moment no locking is done. An empty string will disable the session
+directory.
@@ -445,7 +488,7 @@ to allow comma in the option.
http_proxy = url
- Use a http proxy. Use an empty string to disable.
+Use a http proxy. Use an empty string to disable.
@@ -454,9 +497,9 @@ to allow comma in the option.
encoding_list = encoding
- Add a preferred filename encoding to the list. The encodings
- are attempted in the order they are inserted, if none match
- the torrent default is used.
+Add a preferred filename encoding to the list. The encodings are
+attempted in the order they are inserted, if none match the torrent
+default is used.
@@ -483,7 +526,18 @@ start a task every day at 18:00, use
schedule_remove = id
- Delete id from the scheduler.
+Delete id from the scheduler.
+
+
+
+
+
+ stop_untied =
+ remove_untied =
+
+
+Stop or remove the torrents that are tied to filenames that have been
+deleted, the association is then cleared.
@@ -503,12 +557,12 @@ to the filename provided.
- stop_untied =
- remove_untied =
+ import = file
+ try_import = file
-Stop or remove the torrents that are tied to filenames that have been
-deleted, the association is then cleared.
+Load a resource file. try_import does not throw
+torrent::input_error exception on bad input.
@@ -529,45 +583,53 @@ deleted, the association is then cleared.
hash_read_ahead = MB
- Configure how far ahead we ask the kernel to read when doing
- hash checking. The hash checker uses madvise(...,
- MADV_WILLNEED) for the requests.
+
+Configure how far ahead we ask the kernel to read when doing hash
+checking. The hash checker uses madvise(..., MADV_WILLNEED) for the
+requests.
+
hash_interval = ms
- Interval between attempts to check the hash when the chunk
- is not in memory, in milliseconds.
+
+Interval between attempts to check the hash when the chunk is not in
+memory, in milliseconds.
+
hash_max_tries = tries
- Number of attempts to check the hash while using the mincore
- status, before forcing. Overworked systems might need lower
- values to get a decent hash checking rate.
+
+Number of attempts to check the hash while using the mincore status,
+before forcing. Overworked systems might need lower values to get a
+decent hash checking rate.
+
max_open_files = value
- Number of files to simultaneously keep open. Libtorrent
- dynamically opens and closes files when mapping files to
- memory. Defaults to 128.
+
+Number of files to simultaneously keep open. Libtorrent dynamically
+opens and closes files when mapping files to memory. Defaults to 128.
+
max_open_sockets = value
- Number of sockets to simultaneously keep open. This value is
- set to be sysconf(_SC_OPEN_MAX) - 256
- at startup. This gives the client 128 sockets to use as it
- wishes.
+
+Number of sockets to simultaneously keep open. This value is set to be
+sysconf(_SC_OPEN_MAX) - 256 at startup. This
+gives the client 128 sockets to use as it wishes.
+
@@ -575,8 +637,8 @@ deleted, the association is then cleared.
umask = 0644
- Set the umask for this process, which is applied to all
- files created by the program.
+Set the umask for this process, which is applied to all files created
+by the program.
diff --git a/rak/regex.h b/rak/regex.h
index c6a6b29e..99d53a1e 100644
--- a/rak/regex.h
+++ b/rak/regex.h
@@ -108,113 +108,3 @@ regex::operator () (const std::string& text) const {
}
#endif
-// rak - Rakshasa's toolbox
-// Copyright (C) 2005-2006, Jari Sundell
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// In addition, as a special exception, the copyright holders give
-// permission to link the code of portions of this program with the
-// OpenSSL library under certain conditions as described in each
-// individual source file, and distribute linked combinations
-// including the two.
-//
-// You must obey the GNU General Public License in all respects for
-// all of the code used other than OpenSSL. If you modify file(s)
-// with this exception, you may extend this exception to your version
-// of the file(s), but you are not obligated to do so. If you do not
-// wish to do so, delete this exception statement from your version.
-// If you delete this exception statement from all source files in the
-// program, then also delete it here.
-//
-// Contact: Jari Sundell
-//
-// Skomakerveien 33
-// 3185 Skoppum, NORWAY
-
-// This is a hacked up whole string pattern matching. Replace with
-// TR1's regex when that becomes widely available. It is intended for
-// small strings.
-
-#ifndef RAK_REGEX_H
-#define RAK_REGEX_H
-
-#include
-
-#include
-#include
-#include
-
-namespace rak {
-
-class regex : public std::unary_function {
-public:
- regex() {}
- regex(const std::string& p) : m_pattern(p) {}
-
- const std::string& pattern() const { return m_pattern; }
-
- bool operator () (const std::string& p) const;
-
-private:
- std::string m_pattern;
-};
-
-// This isn't optimized, or very clean. A simple hack that should work.
-bool
-regex::operator () (const std::string& text) const {
- if (m_pattern.empty() ||
- text.empty() ||
- (m_pattern[0] != '*' && m_pattern[0] != text[0]))
- return false;
-
- // Replace with unordered_vector?
- std::list paths;
- paths.push_front(0);
-
- for (std::string::const_iterator itrText = ++text.begin(), lastText = text.end(); itrText != lastText; ++itrText) {
-
- for (std::list::iterator itrPaths = paths.begin(), lastPaths = paths.end(); itrPaths != lastPaths; ) {
-
- unsigned int next = *itrPaths + 1;
-
- if (m_pattern[*itrPaths] != '*')
- itrPaths = paths.erase(itrPaths);
- else
- itrPaths++;
-
- // When we reach the end of 'm_pattern', we don't have a whole
- // match of 'text'.
- if (next == m_pattern.size())
- continue;
-
- // Push to the back so that '*' will match zero length strings.
- if (m_pattern[next] == '*')
- paths.push_back(next);
-
- if (m_pattern[next] == *itrText)
- paths.push_front(next);
- }
-
- if (paths.empty())
- return false;
- }
-
- return std::find(paths.begin(), paths.end(), m_pattern.size() - 1) != paths.end();
-}
-
-}
-
-#endif
diff --git a/src/core/download_factory.cc b/src/core/download_factory.cc
index faffe8bc..63cd4b1e 100644
--- a/src/core/download_factory.cc
+++ b/src/core/download_factory.cc
@@ -36,6 +36,7 @@
#include "config.h"
+#include
#include
#include
#include
@@ -183,6 +184,14 @@ DownloadFactory::receive_success() {
(*itr)->variable()->set("max_peers", control->variable()->get("max_peers"));
(*itr)->variable()->set("max_uploads", control->variable()->get("max_uploads"));
+ if (rtorrent->has_key_value("key")) {
+ (*itr)->tracker_list()->set_key(rtorrent->get_key("key").as_value());
+
+ } else {
+ (*itr)->tracker_list()->set_key(rand() % (std::numeric_limits::max() - 1) + 1);
+ rtorrent->insert_key("key", (*itr)->tracker_list()->key());
+ }
+
if (control->variable()->get_string("use_udp_trackers") == "no")
(*itr)->enable_udp_trackers(false);
diff --git a/src/display/window_tracker_list.cc b/src/display/window_tracker_list.cc
index 5c1b0027..8d26102a 100644
--- a/src/display/window_tracker_list.cc
+++ b/src/display/window_tracker_list.cc
@@ -61,25 +61,23 @@ WindowTrackerList::redraw() {
m_canvas->erase();
int pos = 0;
+ torrent::TrackerList* tl = m_download->tracker_list();
- m_canvas->print( 2, pos, "Trackers:");
-
+ m_canvas->print(2, pos, "Trackers: [Key: %08x]", tl->key());
++pos;
- torrent::TrackerList tl = m_download->download()->tracker_list();
-
- if (tl.size() == 0)
+ if (tl->size() == 0)
return;
- if (*m_focus >= tl.size())
+ if (*m_focus >= tl->size())
throw std::logic_error("WindowTrackerList::redraw() called on an object with a bad focus value.");
typedef std::pair Range;
- Range range = rak::advance_bidirectional(0, *m_focus, tl.size(), (m_canvas->get_height() + 1) / 2);
+ Range range = rak::advance_bidirectional(0, *m_focus, tl->size(), (m_canvas->get_height() + 1) / 2);
while (range.first != range.second) {
- torrent::Tracker t = tl.get(range.first);
+ torrent::Tracker t = tl->get(range.first);
m_canvas->print(0, pos++, "%c %s",
range.first == *m_focus ? '*' : ' ',
@@ -89,7 +87,7 @@ WindowTrackerList::redraw() {
range.first == *m_focus ? '*' : ' ',
t.group(),
rak::copy_escape_html(t.tracker_id()).c_str(),
- range.first == tl.focus() ? "yes" : " no",
+ range.first == tl->focus() ? "yes" : " no",
t.is_enabled() ? "yes" : " no",
t.is_open() ? "yes" : " no",
t.scrape_complete(),