diff --git a/doc/rtorrent.1.xml b/doc/rtorrent.1.xml
index ec1b8c5a..a84201e1 100644
--- a/doc/rtorrent.1.xml
+++ b/doc/rtorrent.1.xml
@@ -139,6 +139,21 @@
+
+ ^O
+
+ Change the destination directory of the download. The
+ torrent must be closed.
+
+
+
+
+ + | -
+
+ Change the priority of the download.
+
+
+
backspace
@@ -155,6 +170,13 @@
+
+ ^P
+
+ Call commands or change settings.
+
+
+
@@ -424,6 +446,11 @@ seconds, starting from start. An
start of zero calls it immediately. Currently
command is forwarded to the option handler.
+start and interval may
+optionally use a time format, dd:hh:mm:ss. F.ex to
+start a task every day at 18:00, use
+18:00:00.
+
@@ -455,9 +482,8 @@ to the filename provided.
remove_untied =
-Stop or remove the torrents that are tied to filenames that has been
-deleted, the association is then cleared. Don't use
-remove_untied as it crashes the client.
+Stop or remove the torrents that are tied to filenames that have been
+deleted, the association is then cleared.
@@ -530,23 +556,34 @@ deleted, the association is then cleared. Don't use
-
-
-
-
-
-
-
-
-
+
+ working_directory = directory
+
-
-
-
-
-
-
-
+Changes the working directory of the process using
+chdir.
+
+
+
+
+
+ session_on_completion = yes
+
+
+Controls whetever the session torrent is updated when a torrent
+finishes. By default on.
+
+
+
+
+
+ session_lock = yes
+
+
+Controls whetever a lock file is created in the session directory.
+
+
+
diff --git a/src/control.cc b/src/control.cc
index ba209955..df98ec34 100644
--- a/src/control.cc
+++ b/src/control.cc
@@ -53,6 +53,7 @@
Control::Control() :
m_shutdownReceived(false),
+ m_shutdownQuick(false),
m_ui(new ui::Root()),
m_core(new core::Manager()),
@@ -92,8 +93,6 @@ Control::initialize() {
display::Window::slot_unschedule(rak::make_mem_fun(m_display, &display::Manager::unschedule));
display::Window::slot_adjust(rak::make_mem_fun(m_display, &display::Manager::adjust_layout));
-// m_core->get_poll_manager()->signal_interrupted().connect(sigc::mem_fun(*m_inputStdin, &input::InputEvent::event_read));
-// m_core->get_poll_manager()->signal_interrupted().connect(sigc::ptr_fun(display::Canvas::do_update));
m_core->get_poll_manager()->get_http_stack()->set_user_agent(std::string(PACKAGE "/" VERSION "/") + torrent::version());
m_core->initialize_second();
diff --git a/src/core/curl_get.cc b/src/core/curl_get.cc
index d3c9ea67..e4539b70 100644
--- a/src/core/curl_get.cc
+++ b/src/core/curl_get.cc
@@ -152,9 +152,7 @@ CurlGet::perform(CURLMsg* msg) {
else
m_signalFailed.emit(curl_easy_strerror(msg->data.result));
- if (m_handle != NULL)
- throw std::logic_error("CurlGet::perform finished but the object wasn't closed.");
-
+ // Do nothing below after emitting the signals.
}
}
diff --git a/src/core/download.cc b/src/core/download.cc
index 31d8983d..bbb53ad9 100644
--- a/src/core/download.cc
+++ b/src/core/download.cc
@@ -97,14 +97,14 @@ Download::~Download() {
void
Download::start() {
- if (is_done()) {
+ if (is_done())
m_download.set_connection_type(string_to_connection_type(m_variables.get("connection_seed").as_string()));
- torrent::download_set_priority(m_download, 2);
- } else {
+ else
m_download.set_connection_type(string_to_connection_type(m_variables.get("connection_leech").as_string()));
- torrent::download_set_priority(m_download, 4);
- }
+ // Update the priority to ensure it has the correct
+ // seeding/unfinished modifiers.
+ set_priority(priority());
m_download.start();
}
@@ -128,7 +128,12 @@ Download::set_priority(uint32_t p) {
if (p >= 4)
throw torrent::input_error("Priority out of range.");
- torrent::download_set_priority(m_download, p * p);
+ // Seeding torrents get half the priority of unfinished torrents.
+ if (!is_done())
+ torrent::download_set_priority(m_download, p * p * 2);
+ else
+ torrent::download_set_priority(m_download, p * p);
+
get_bencode().get_key("rtorrent").insert_key("priority", (int64_t)p);
}
diff --git a/src/core/download_factory.cc b/src/core/download_factory.cc
index 360ceeba..b0455bf2 100644
--- a/src/core/download_factory.cc
+++ b/src/core/download_factory.cc
@@ -49,6 +49,7 @@
#include "globals.h"
#include "manager.h"
+#include "download.h"
#include "download_factory.h"
namespace core {
diff --git a/src/core/download_list.cc b/src/core/download_list.cc
index d211e327..f61161d4 100644
--- a/src/core/download_list.cc
+++ b/src/core/download_list.cc
@@ -47,6 +47,16 @@
namespace core {
+struct download_list_call {
+ download_list_call(Download* d) : m_download(d) {}
+
+ void operator () (const DownloadList::SlotMap::value_type& s) {
+ s.second(m_download);
+ }
+
+ Download* m_download;
+};
+
DownloadList::iterator
DownloadList::insert(std::istream* str) {
torrent::Download d = torrent::download_add(str);
@@ -54,14 +64,14 @@ DownloadList::insert(std::istream* str) {
iterator itr = Base::insert(end(), new Download(d));
(*itr)->get_download().signal_download_done(sigc::bind(sigc::mem_fun(*this, &DownloadList::finished), *itr));
- m_slotMapInsert.for_each(*itr);
+ std::for_each(m_slotMapInsert.begin(), m_slotMapInsert.end(), download_list_call(*itr));
return itr;
}
DownloadList::iterator
DownloadList::erase(iterator itr) {
- m_slotMapErase.for_each(*itr);
+ std::for_each(m_slotMapErase.begin(), m_slotMapErase.end(), download_list_call(*itr));
torrent::download_remove((*itr)->get_download());
delete *itr;
@@ -74,7 +84,7 @@ DownloadList::open(Download* d) {
if (d->get_download().is_open())
return;
- m_slotMapOpen.for_each(d);
+ std::for_each(m_slotMapOpen.begin(), m_slotMapOpen.end(), download_list_call(d));
}
void
@@ -83,7 +93,7 @@ DownloadList::close(Download* d) {
return;
stop(d);
- m_slotMapClose.for_each(d);
+ std::for_each(m_slotMapClose.begin(), m_slotMapClose.end(), download_list_call(d));
}
void
@@ -93,7 +103,7 @@ DownloadList::start(Download* d) {
return;
open(d);
- m_slotMapStart.for_each(d);
+ std::for_each(m_slotMapStart.begin(), m_slotMapStart.end(), download_list_call(d));
}
void
@@ -101,7 +111,7 @@ DownloadList::stop(Download* d) {
if (!d->get_download().is_active())
return;
- m_slotMapStop.for_each(d);
+ std::for_each(m_slotMapStop.begin(), m_slotMapStop.end(), download_list_call(d));
}
void
@@ -113,7 +123,7 @@ DownloadList::clear() {
void
DownloadList::finished(Download* d) {
- m_slotMapFinished.for_each(d);
+ std::for_each(m_slotMapFinished.begin(), m_slotMapFinished.end(), download_list_call(d));
}
}
diff --git a/src/core/download_list.h b/src/core/download_list.h
index 12637679..431a0460 100644
--- a/src/core/download_list.h
+++ b/src/core/download_list.h
@@ -39,8 +39,9 @@
#include
#include
-
-#include "download_slot_map.h"
+#include