mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-15 06:32:31 +00:00
* Minor BSD portability fixes.
* Added torrent::TrackerList::{set_,}key() and made rtorrent save the
key between sessions.
* Added import option to the man page.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@665 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
@@ -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<uint32_t>::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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user