* 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:
rakshasa
2006-04-06 16:40:25 +00:00
parent 8a8cfe5e3d
commit dc1f6d4f23
4 changed files with 141 additions and 182 deletions
+9
View File
@@ -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);