Added start/stop keys.

Added more extensive download status information where only tracker
status used to be.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@279 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-02-15 21:59:35 +00:00
parent f348196f2e
commit 46120cbb30
16 changed files with 182 additions and 71 deletions
+29 -5
View File
@@ -6,11 +6,29 @@
#include <sigc++/bind.h>
#include <torrent/exceptions.h>
#include <torrent/http.h>
#include <torrent/torrent.h>
#include "manager.h"
namespace core {
void
Manager::initialize() {
torrent::Http::set_factory(m_poll.get_http_factory());
m_httpQueue.slot_factory(m_poll.get_http_factory());
CurlStack::init();
torrent::initialize();
torrent::listen_open(10000, 20000);
}
void
Manager::cleanup() {
torrent::cleanup();
core::CurlStack::cleanup();
}
void
Manager::insert(const std::string& uri) {
if (std::strncmp(uri.c_str(), "http://", 7))
@@ -24,14 +42,20 @@ Manager::start(Download* d) {
if (d->get_download().is_active())
return;
if (d->get_download().is_open()) {
d->start();
} else {
if (!d->get_download().is_open())
d->open();
if (d->get_download().is_hash_checked())
d->start();
else
m_hashQueue.insert(d, sigc::mem_fun(*d, &Download::start));
}
}
void
Manager::stop(Download* d) {
m_hashQueue.remove(d);
d->stop();
}
void