mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 07:02:30 +00:00
* Use HashString for hash and id which contains the 20 byte array
directly, instead of using std::string. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@799 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -92,7 +92,7 @@ Download::Download(download_type d) :
|
||||
|
||||
m_variables.insert("directory", new utils::VariableStringSlot(rak::mem_fn(&m_fileList, &torrent::FileList::root_dir), rak::mem_fn(this, &Download::set_root_directory)));
|
||||
|
||||
m_variables.insert("info_hash", new utils::VariableStringSlot(rak::mem_fn(&m_download, &torrent::Download::info_hash), NULL));
|
||||
// m_variables.insert("info_hash", new utils::VariableStringSlot(rak::mem_fn(&m_download, &torrent::Download::info_hash), NULL));
|
||||
|
||||
m_variables.insert("min_peers", new utils::VariableValueSlot(rak::mem_fn(&m_download, &download_type::peers_min), rak::mem_fn(&m_download, &download_type::set_peers_min)));
|
||||
m_variables.insert("max_peers", new utils::VariableValueSlot(rak::mem_fn(&m_download, &download_type::peers_max), rak::mem_fn(&m_download, &download_type::set_peers_max)));
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <sigc++/connection.h>
|
||||
#include <torrent/download.h>
|
||||
#include <torrent/file_list.h>
|
||||
#include <torrent/hash_string.h>
|
||||
#include <torrent/tracker_list.h>
|
||||
#include <torrent/torrent.h>
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ DownloadStore::is_correct_format(std::string f) {
|
||||
|
||||
std::string
|
||||
DownloadStore::create_filename(Download* d) {
|
||||
return m_path + rak::transform_hex(d->download()->info_hash()) + ".torrent";
|
||||
return m_path + rak::transform_hex(d->download()->info_hash().begin(), d->download()->info_hash().end()) + ".torrent";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+7
-5
@@ -107,7 +107,7 @@ receive_tracker_dump(const std::string& url, const char* data, size_t size) {
|
||||
}
|
||||
|
||||
void
|
||||
Manager::handshake_log(const sockaddr* sa, torrent::ConnectionManager::HandshakeMessage msg, int err, std::string hash) {
|
||||
Manager::handshake_log(const sockaddr* sa, torrent::ConnectionManager::HandshakeMessage msg, int err, const torrent::HashString* hash) {
|
||||
if (!control->variable()->get_value("handshake_log"))
|
||||
return;
|
||||
|
||||
@@ -115,6 +115,7 @@ Manager::handshake_log(const sockaddr* sa, torrent::ConnectionManager::Handshake
|
||||
std::string download;
|
||||
|
||||
const rak::socket_address* socketAddress = rak::socket_address::cast_from(sa);
|
||||
|
||||
if (socketAddress->is_valid()) {
|
||||
char port[6];
|
||||
snprintf(port, sizeof(port), "%d", socketAddress->port());
|
||||
@@ -123,10 +124,11 @@ Manager::handshake_log(const sockaddr* sa, torrent::ConnectionManager::Handshake
|
||||
peer = "(unknown)";
|
||||
}
|
||||
|
||||
torrent::Download d = torrent::download_find(hash);
|
||||
if (d.is_valid())
|
||||
download = ": " + d.name();
|
||||
else
|
||||
// torrent::Download d = torrent::download_find(hash);
|
||||
|
||||
// if (d.is_valid())
|
||||
// download = ": " + d.name();
|
||||
// else
|
||||
download = "";
|
||||
|
||||
switch (msg) {
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public:
|
||||
|
||||
void push_log(const std::string& msg) { m_logImportant.push_front(msg); m_logComplete.push_front(msg); }
|
||||
|
||||
void handshake_log(const sockaddr* sa, torrent::ConnectionManager::HandshakeMessage msg, int err, std::string hash);
|
||||
void handshake_log(const sockaddr* sa, torrent::ConnectionManager::HandshakeMessage msg, int err, const torrent::HashString* hash);
|
||||
|
||||
// Temporary, find a better place for this.
|
||||
void try_create_download(const std::string& uri, bool start, bool printLog = true, bool tied = false);
|
||||
|
||||
Reference in New Issue
Block a user