mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 23:22:31 +00:00
* Fixed a regression that threw an exception for torrents with
empty directories. * When receiving zero length pieces, remove them from the request list. * Send the interested state before any requests as some clients, BitTornado 0.7.14 and uTorrent 0.3.0, disconnect if a request has been received while uninterested. * WITH_POSIX_FALLOCATE configure macro should check against "yes", not "no". * The new priority queue would cause arg torrents to load before session torrents in some cases. Fixed to perform the session torrent tasks before loading arg torrents. * Allow '*' wildcard in filenames when loading torrents. * Added load, load_run, stop_tied and remove_tied settings which can be used to scan a directory for new/removed torrents. These torrents are tied to the lifetime of the torrent file. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@616 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+14
-24
@@ -143,6 +143,11 @@ initialize_option_handler(Control* c, OptionHandler* optionHandler) {
|
||||
optionHandler->insert("connection_leech", new OptionHandlerString(c, &apply_connection_leech));
|
||||
optionHandler->insert("connection_seed", new OptionHandlerString(c, &apply_connection_seed));
|
||||
|
||||
optionHandler->insert("load", new OptionHandlerString(c, &apply_load));
|
||||
optionHandler->insert("load_run", new OptionHandlerString(c, &apply_load_run));
|
||||
optionHandler->insert("stop_untied", new OptionHandlerString(c, &apply_stop_untied));
|
||||
optionHandler->insert("remove_untied", new OptionHandlerString(c, &apply_remove_untied));
|
||||
|
||||
optionHandler->insert("session", new OptionHandlerString(c, &apply_session_directory));
|
||||
optionHandler->insert("encoding_list", new OptionHandlerString(c, &apply_encoding_list));
|
||||
optionHandler->insert("tracker_dump", new OptionHandlerString(c, &apply_tracker_dump));
|
||||
@@ -220,15 +225,15 @@ main(int argc, char** argv) {
|
||||
|
||||
// Just to make sure we did all the stuff on the queue before
|
||||
// loading any torrents.
|
||||
while (!taskScheduler.empty() && taskScheduler.top()->time() <= cachedTime) {
|
||||
rak::priority_item* v = taskScheduler.top();
|
||||
taskScheduler.pop();
|
||||
|
||||
v->clear_time();
|
||||
v->call();
|
||||
}
|
||||
//
|
||||
// Remove this?
|
||||
//rak::priority_queue_perform(&taskScheduler, cachedTime);
|
||||
|
||||
// Load session torrents and perform scheduled tasks to ensure
|
||||
// session torrents are loaded before arg torrents.
|
||||
load_session_torrents(&control);
|
||||
rak::priority_queue_perform(&taskScheduler, cachedTime);
|
||||
|
||||
load_arg_torrents(&control, argv + firstArg, argv + argc);
|
||||
|
||||
control.display()->adjust_layout();
|
||||
@@ -237,22 +242,7 @@ main(int argc, char** argv) {
|
||||
countTicks++;
|
||||
|
||||
cachedTime = rak::timer::current();
|
||||
|
||||
// std::list<rak::priority_item*> workQueue;
|
||||
|
||||
// std::copy(rak::queue_popper(taskScheduler, rak::bind2nd(std::mem_fun(&rak::priority_item::compare), cachedTime)),
|
||||
// rak::queue_popper(taskScheduler, rak::bind2nd(std::mem_fun(&rak::priority_item::compare), rak::timer())),
|
||||
// std::back_inserter(workQueue));
|
||||
// std::for_each(workQueue.begin(), workQueue.end(), std::mem_fun(&rak::priority_item::clear_time));
|
||||
// std::for_each(workQueue.begin(), workQueue.end(), std::mem_fun(&rak::priority_item::call));
|
||||
|
||||
while (!taskScheduler.empty() && taskScheduler.top()->time() <= cachedTime) {
|
||||
rak::priority_item* v = taskScheduler.top();
|
||||
taskScheduler.pop();
|
||||
|
||||
v->clear_time();
|
||||
v->call();
|
||||
}
|
||||
rak::priority_queue_perform(&taskScheduler, cachedTime);
|
||||
|
||||
// This needs to be called every second or so. Currently done by
|
||||
// the throttle task in libtorrent.
|
||||
@@ -268,7 +258,7 @@ main(int argc, char** argv) {
|
||||
} catch (torrent::base_error& e) {
|
||||
display::Canvas::cleanup();
|
||||
|
||||
std::cout << "Caught exception from libtorrent: " << e.what() << std::endl;
|
||||
std::cout << "Caught exception: " << e.what() << std::endl;
|
||||
return -1;
|
||||
|
||||
} catch (std::exception& e) {
|
||||
|
||||
Reference in New Issue
Block a user