Merge branch 'master' into xirvik

This commit is contained in:
rakshasa
2012-04-02 16:05:26 +09:00
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
AC_INIT(rtorrent, 0.8.9, jaris@ifi.uio.no)
AC_DEFINE(API_VERSION, 2, api version)
AC_DEFINE(API_VERSION, 3, api version)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
+12
View File
@@ -328,6 +328,16 @@ apply_d_add_peer(core::Download* download, const std::string& arg) {
torrent::connection_manager()->resolver()(host, (int)rak::socket_address::pf_inet, SOCK_STREAM, call_add_d_peer_t(download, port));
}
torrent::Object
d_chunks_seen(core::Download* download) {
const uint8_t* seen = download->download()->chunks_seen();
if (seen == NULL)
return std::string();
else
return std::string((const char*)seen, download->download()->file_list()->size_chunks());
}
torrent::Object
f_multicall(core::Download* download, const torrent::Object::list_type& args) {
if (args.empty())
@@ -813,6 +823,8 @@ initialize_command_download() {
CMD2_DL ("d.size_pex", CMD2_ON_DL(size_pex));
CMD2_DL ("d.max_size_pex", CMD2_ON_DL(max_size_pex));
CMD2_DL ("d.chunks_seen", tr1::bind(&d_chunks_seen, tr1::placeholders::_1));
CMD2_DL ("d.completed_bytes", CMD2_ON_FL(completed_bytes));
CMD2_DL ("d.completed_chunks", CMD2_ON_FL(completed_chunks));
CMD2_DL ("d.left_bytes", CMD2_ON_FL(left_bytes));