mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-16 22:26:16 +00:00
Merge branch 'master' into xirvik
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
AC_INIT(rtorrent, 0.8.9, jaris@ifi.uio.no)
|
AC_INIT(rtorrent, 0.8.9, jaris@ifi.uio.no)
|
||||||
|
|
||||||
AC_DEFINE(API_VERSION, 3, api version)
|
AC_DEFINE(API_VERSION, 4, api version)
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
|||||||
+10
-4
@@ -285,8 +285,8 @@ retrieve_d_bitfield(core::Download* download) {
|
|||||||
// Just a helper function atm.
|
// Just a helper function atm.
|
||||||
torrent::Object
|
torrent::Object
|
||||||
cmd_d_initialize_logs(core::Download* download) {
|
cmd_d_initialize_logs(core::Download* download) {
|
||||||
download->info()->signal_network_log().connect(sigc::mem_fun(control->core(), &core::Manager::push_log_complete));
|
download->info()->signal_network_log().push_back(tr1::bind(&core::Manager::push_log_complete, control->core(), tr1::placeholders::_1));
|
||||||
download->info()->signal_storage_error().connect(sigc::mem_fun(control->core(), &core::Manager::push_log_complete));
|
download->info()->signal_storage_error().push_back(tr1::bind(&core::Manager::push_log_complete, control->core(), tr1::placeholders::_1));
|
||||||
|
|
||||||
return torrent::Object();
|
return torrent::Object();
|
||||||
}
|
}
|
||||||
@@ -334,8 +334,14 @@ d_chunks_seen(core::Download* download) {
|
|||||||
|
|
||||||
if (seen == NULL)
|
if (seen == NULL)
|
||||||
return std::string();
|
return std::string();
|
||||||
else
|
|
||||||
return std::string((const char*)seen, download->download()->file_list()->size_chunks());
|
uint32_t size = download->download()->file_list()->size_chunks();
|
||||||
|
|
||||||
|
std::string result;
|
||||||
|
result.resize(size * 2);
|
||||||
|
|
||||||
|
rak::transform_hex((const char*)seen, (const char*)seen + size, result.begin());
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
torrent::Object
|
torrent::Object
|
||||||
|
|||||||
+12
-1
@@ -113,10 +113,16 @@ void
|
|||||||
initialize_command_tracker() {
|
initialize_command_tracker() {
|
||||||
CMD2_TRACKER ("t.is_open", tr1::bind(&torrent::Tracker::is_busy, tr1::placeholders::_1));
|
CMD2_TRACKER ("t.is_open", tr1::bind(&torrent::Tracker::is_busy, tr1::placeholders::_1));
|
||||||
CMD2_TRACKER ("t.is_enabled", tr1::bind(&torrent::Tracker::is_enabled, tr1::placeholders::_1));
|
CMD2_TRACKER ("t.is_enabled", tr1::bind(&torrent::Tracker::is_enabled, tr1::placeholders::_1));
|
||||||
CMD2_TRACKER_VALUE_V("t.is_enabled.set", tr1::bind(&tracker_set_enabled, tr1::placeholders::_1, tr1::placeholders::_2));
|
CMD2_TRACKER ("t.is_usable", tr1::bind(&torrent::Tracker::is_usable, tr1::placeholders::_1));
|
||||||
|
CMD2_TRACKER ("t.is_busy", tr1::bind(&torrent::Tracker::is_busy, tr1::placeholders::_1));
|
||||||
|
CMD2_TRACKER ("t.is_extra_tracker", tr1::bind(&torrent::Tracker::is_extra_tracker, tr1::placeholders::_1));
|
||||||
|
CMD2_TRACKER ("t.can_scrape", tr1::bind(&torrent::Tracker::can_scrape, tr1::placeholders::_1));
|
||||||
|
|
||||||
CMD2_TRACKER_V ("t.enable", tr1::bind(&torrent::Tracker::enable, tr1::placeholders::_1));
|
CMD2_TRACKER_V ("t.enable", tr1::bind(&torrent::Tracker::enable, tr1::placeholders::_1));
|
||||||
CMD2_TRACKER_V ("t.disable", tr1::bind(&torrent::Tracker::disable, tr1::placeholders::_1));
|
CMD2_TRACKER_V ("t.disable", tr1::bind(&torrent::Tracker::disable, tr1::placeholders::_1));
|
||||||
|
|
||||||
|
CMD2_TRACKER_VALUE_V("t.is_enabled.set", tr1::bind(&tracker_set_enabled, tr1::placeholders::_1, tr1::placeholders::_2));
|
||||||
|
|
||||||
CMD2_TRACKER ("t.url", tr1::bind(&torrent::Tracker::url, tr1::placeholders::_1));
|
CMD2_TRACKER ("t.url", tr1::bind(&torrent::Tracker::url, tr1::placeholders::_1));
|
||||||
CMD2_TRACKER ("t.group", tr1::bind(&torrent::Tracker::group, tr1::placeholders::_1));
|
CMD2_TRACKER ("t.group", tr1::bind(&torrent::Tracker::group, tr1::placeholders::_1));
|
||||||
CMD2_TRACKER ("t.type", tr1::bind(&torrent::Tracker::type, tr1::placeholders::_1));
|
CMD2_TRACKER ("t.type", tr1::bind(&torrent::Tracker::type, tr1::placeholders::_1));
|
||||||
@@ -131,9 +137,14 @@ initialize_command_tracker() {
|
|||||||
CMD2_TRACKER ("t.normal_interval", tr1::bind(&torrent::Tracker::normal_interval, tr1::placeholders::_1));
|
CMD2_TRACKER ("t.normal_interval", tr1::bind(&torrent::Tracker::normal_interval, tr1::placeholders::_1));
|
||||||
CMD2_TRACKER ("t.min_interval", tr1::bind(&torrent::Tracker::min_interval, tr1::placeholders::_1));
|
CMD2_TRACKER ("t.min_interval", tr1::bind(&torrent::Tracker::min_interval, tr1::placeholders::_1));
|
||||||
|
|
||||||
|
CMD2_TRACKER ("t.activity_time_next", tr1::bind(&torrent::Tracker::activity_time_next, tr1::placeholders::_1));
|
||||||
|
CMD2_TRACKER ("t.activity_time_last", tr1::bind(&torrent::Tracker::activity_time_last, tr1::placeholders::_1));
|
||||||
|
|
||||||
|
CMD2_TRACKER ("t.success_time_next", tr1::bind(&torrent::Tracker::success_time_next, tr1::placeholders::_1));
|
||||||
CMD2_TRACKER ("t.success_time_last", tr1::bind(&torrent::Tracker::success_time_last, tr1::placeholders::_1));
|
CMD2_TRACKER ("t.success_time_last", tr1::bind(&torrent::Tracker::success_time_last, tr1::placeholders::_1));
|
||||||
CMD2_TRACKER ("t.success_counter", tr1::bind(&torrent::Tracker::success_counter, tr1::placeholders::_1));
|
CMD2_TRACKER ("t.success_counter", tr1::bind(&torrent::Tracker::success_counter, tr1::placeholders::_1));
|
||||||
|
|
||||||
|
CMD2_TRACKER ("t.failed_time_next", tr1::bind(&torrent::Tracker::failed_time_next, tr1::placeholders::_1));
|
||||||
CMD2_TRACKER ("t.failed_time_last", tr1::bind(&torrent::Tracker::failed_time_last, tr1::placeholders::_1));
|
CMD2_TRACKER ("t.failed_time_last", tr1::bind(&torrent::Tracker::failed_time_last, tr1::placeholders::_1));
|
||||||
CMD2_TRACKER ("t.failed_counter", tr1::bind(&torrent::Tracker::failed_counter, tr1::placeholders::_1));
|
CMD2_TRACKER ("t.failed_counter", tr1::bind(&torrent::Tracker::failed_counter, tr1::placeholders::_1));
|
||||||
|
|
||||||
|
|||||||
@@ -65,21 +65,16 @@ Download::Download(download_type d) :
|
|||||||
m_resumeFlags(~uint32_t()),
|
m_resumeFlags(~uint32_t()),
|
||||||
m_group(0) {
|
m_group(0) {
|
||||||
|
|
||||||
m_connTrackerSucceeded = m_download.info()->signal_tracker_success().connect(sigc::bind(sigc::mem_fun(*this, &Download::receive_tracker_msg), ""));
|
m_download.info()->signal_tracker_success().push_back(tr1::bind(&Download::receive_tracker_msg, this, ""));
|
||||||
m_connTrackerFailed = m_download.info()->signal_tracker_failed().connect(sigc::mem_fun(*this, &Download::receive_tracker_msg));
|
m_download.info()->signal_tracker_failed().push_back(tr1::bind(&Download::receive_tracker_msg, this, tr1::placeholders::_1));
|
||||||
m_connStorageError = m_download.info()->signal_storage_error().connect(sigc::mem_fun(*this, &Download::receive_storage_error));
|
m_download.info()->signal_storage_error().push_back(tr1::bind(&Download::receive_storage_error, this, tr1::placeholders::_1));
|
||||||
|
m_download.info()->signal_chunk_failed().push_back(tr1::bind(&Download::receive_chunk_failed, this, tr1::placeholders::_1));
|
||||||
m_download.info()->signal_chunk_failed().connect(sigc::mem_fun(*this, &Download::receive_chunk_failed));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Download::~Download() {
|
Download::~Download() {
|
||||||
if (!m_download.is_valid())
|
if (!m_download.is_valid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_connTrackerSucceeded.disconnect();
|
|
||||||
m_connTrackerFailed.disconnect();
|
|
||||||
m_connStorageError.disconnect();
|
|
||||||
|
|
||||||
m_download = download_type();
|
m_download = download_type();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -155,10 +155,6 @@ private:
|
|||||||
|
|
||||||
uint32_t m_resumeFlags;
|
uint32_t m_resumeFlags;
|
||||||
|
|
||||||
sigc::connection m_connTrackerSucceeded;
|
|
||||||
sigc::connection m_connTrackerFailed;
|
|
||||||
sigc::connection m_connStorageError;
|
|
||||||
|
|
||||||
unsigned int m_group;
|
unsigned int m_group;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -65,8 +65,12 @@ ElementPeerList::ElementPeerList(core::Download* d) :
|
|||||||
std::for_each(m_download->download()->connection_list()->begin(), m_download->download()->connection_list()->end(),
|
std::for_each(m_download->download()->connection_list()->begin(), m_download->download()->connection_list()->end(),
|
||||||
rak::bind1st(std::mem_fun<void,PList,PList::const_reference>(&PList::push_back), &m_list));
|
rak::bind1st(std::mem_fun<void,PList,PList::const_reference>(&PList::push_back), &m_list));
|
||||||
|
|
||||||
m_connPeerConnected = m_download->download()->connection_list()->signal_connected().connect(sigc::mem_fun(*this, &ElementPeerList::receive_peer_connected));
|
torrent::ConnectionList* connection_list = m_download->download()->connection_list();
|
||||||
m_connPeerDisconnected = m_download->download()->connection_list()->signal_disconnected().connect(sigc::mem_fun(*this, &ElementPeerList::receive_peer_disconnected));
|
|
||||||
|
m_peer_connected = connection_list->signal_connected().insert(connection_list->signal_connected().end(),
|
||||||
|
tr1::bind(&ElementPeerList::receive_peer_connected, this, tr1::placeholders::_1));
|
||||||
|
m_peer_disconnected = connection_list->signal_disconnected().insert(connection_list->signal_disconnected().end(),
|
||||||
|
tr1::bind(&ElementPeerList::receive_peer_disconnected, this, tr1::placeholders::_1));
|
||||||
|
|
||||||
m_windowList = new display::WindowPeerList(m_download, &m_list, &m_listItr);
|
m_windowList = new display::WindowPeerList(m_download, &m_list, &m_listItr);
|
||||||
m_elementInfo = create_info();
|
m_elementInfo = create_info();
|
||||||
@@ -84,8 +88,10 @@ ElementPeerList::ElementPeerList(core::Download* d) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
ElementPeerList::~ElementPeerList() {
|
ElementPeerList::~ElementPeerList() {
|
||||||
m_connPeerConnected.disconnect();
|
torrent::ConnectionList* connection_list = m_download->download()->connection_list();
|
||||||
m_connPeerDisconnected.disconnect();
|
|
||||||
|
connection_list->signal_connected().erase(m_peer_connected);
|
||||||
|
connection_list->signal_disconnected().erase(m_peer_disconnected);
|
||||||
|
|
||||||
delete m_windowList;
|
delete m_windowList;
|
||||||
delete m_elementInfo;
|
delete m_elementInfo;
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
#ifndef RTORRENT_UI_ELEMENT_PEER_LIST_H
|
#ifndef RTORRENT_UI_ELEMENT_PEER_LIST_H
|
||||||
#define RTORRENT_UI_ELEMENT_PEER_LIST_H
|
#define RTORRENT_UI_ELEMENT_PEER_LIST_H
|
||||||
|
|
||||||
|
#include <torrent/peer/connection_list.h>
|
||||||
|
|
||||||
#include "core/download.h"
|
#include "core/download.h"
|
||||||
|
|
||||||
#include "element_base.h"
|
#include "element_base.h"
|
||||||
@@ -49,6 +51,8 @@ class ElementPeerList : public ElementBase {
|
|||||||
public:
|
public:
|
||||||
typedef std::list<torrent::Peer*> PList;
|
typedef std::list<torrent::Peer*> PList;
|
||||||
|
|
||||||
|
typedef torrent::ConnectionList::signal_peer_type::iterator signal_connection;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DISPLAY_LIST,
|
DISPLAY_LIST,
|
||||||
DISPLAY_INFO,
|
DISPLAY_INFO,
|
||||||
@@ -89,8 +93,8 @@ private:
|
|||||||
PList m_list;
|
PList m_list;
|
||||||
PList::iterator m_listItr;
|
PList::iterator m_listItr;
|
||||||
|
|
||||||
sigc::connection m_connPeerConnected;
|
signal_connection m_peer_connected;
|
||||||
sigc::connection m_connPeerDisconnected;
|
signal_connection m_peer_disconnected;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user