mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 13:12:32 +00:00
* Moved ConnectionList into the API and made rtorrent use it.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1010 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+3
-2
@@ -45,6 +45,7 @@
|
||||
#include <torrent/torrent.h>
|
||||
#include <torrent/tracker_list.h>
|
||||
#include <torrent/data/file_list.h>
|
||||
#include <torrent/peer/connection_list.h>
|
||||
|
||||
#include "core/download.h"
|
||||
#include "input/manager.h"
|
||||
@@ -293,14 +294,14 @@ void
|
||||
Download::receive_min_peers(int t) {
|
||||
m_windowDownloadStatus->mark_dirty();
|
||||
|
||||
m_download->download()->set_peers_min(std::max(m_download->download()->peers_min() + t, (uint32_t)5));
|
||||
m_download->download()->connection_list()->set_min_size(std::max(m_download->download()->connection_list()->min_size() + t, (uint32_t)5));
|
||||
}
|
||||
|
||||
void
|
||||
Download::receive_max_peers(int t) {
|
||||
m_windowDownloadStatus->mark_dirty();
|
||||
|
||||
m_download->download()->set_peers_max(std::max(m_download->download()->peers_max() + t, (uint32_t)5));
|
||||
m_download->download()->connection_list()->set_max_size(std::max(m_download->download()->connection_list()->max_size() + t, (uint32_t)5));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <torrent/exceptions.h>
|
||||
#include <torrent/rate.h>
|
||||
#include <torrent/hash_string.h>
|
||||
#include <torrent/peer/connection_list.h>
|
||||
#include <torrent/peer/peer_info.h>
|
||||
|
||||
#include "display/frame.h"
|
||||
@@ -61,10 +62,11 @@ ElementPeerList::ElementPeerList(core::Download* d) :
|
||||
|
||||
m_listItr = m_list.end();
|
||||
|
||||
m_download->download()->peer_list(m_list);
|
||||
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));
|
||||
|
||||
m_connPeerConnected = m_download->download()->signal_peer_connected(sigc::mem_fun(*this, &ElementPeerList::receive_peer_connected));
|
||||
m_connPeerDisconnected = m_download->download()->signal_peer_disconnected(sigc::mem_fun(*this, &ElementPeerList::receive_peer_disconnected));
|
||||
m_connPeerConnected = m_download->download()->connection_list()->signal_connected().connect(sigc::mem_fun(*this, &ElementPeerList::receive_peer_connected));
|
||||
m_connPeerDisconnected = m_download->download()->connection_list()->signal_disconnected().connect(sigc::mem_fun(*this, &ElementPeerList::receive_peer_disconnected));
|
||||
|
||||
m_windowList = new display::WindowPeerList(m_download, &m_list, &m_listItr);
|
||||
m_elementInfo = create_info();
|
||||
|
||||
Reference in New Issue
Block a user