mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-19 23:56:16 +00:00
Fixed memory leak of PeerConnection::m_read and
PeerConnection::m_write. Moved src/net/protocol_* to src/peer/. Moved over to using PeerConnectionBase and created factory class and setting for seeder/leecher. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@483 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -31,6 +31,21 @@
|
||||
|
||||
namespace core {
|
||||
|
||||
Download::Download() :
|
||||
m_connectionLeech("default"),
|
||||
m_connectionSeed("default") {
|
||||
}
|
||||
|
||||
void
|
||||
Download::start() {
|
||||
if (is_done())
|
||||
m_download.set_connection_type(m_connectionSeed);
|
||||
else
|
||||
m_download.set_connection_type(m_connectionLeech);
|
||||
|
||||
m_download.start();
|
||||
}
|
||||
|
||||
void
|
||||
Download::set_download(torrent::Download d) {
|
||||
m_download = d;
|
||||
@@ -49,9 +64,19 @@ Download::set_root_directory(const std::string& d) {
|
||||
|
||||
void
|
||||
Download::release_download() {
|
||||
if (!m_download.is_valid())
|
||||
return;
|
||||
|
||||
m_connTrackerSucceded.disconnect();
|
||||
m_connTrackerFailed.disconnect();
|
||||
m_connStorageError.disconnect();
|
||||
|
||||
m_download = torrent::Download();
|
||||
}
|
||||
|
||||
void
|
||||
Download::receive_finished() {
|
||||
m_download.set_connection_type(m_connectionSeed);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user