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:
rakshasa
2005-07-01 15:38:39 +00:00
parent 98ad8e8791
commit 758bbc9faf
10 changed files with 97 additions and 82 deletions
+25
View File
@@ -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