mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-13 13:42:30 +00:00
rtorrent: Polling http and torrent. Improved the download list.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@247 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+13
-13
@@ -3,17 +3,14 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <torrent/torrent.h>
|
||||
#include <torrent/http.h>
|
||||
#include <sigc++/bind.h>
|
||||
|
||||
#include "display/canvas.h"
|
||||
#include "display/manager.h"
|
||||
#include "display/window_downloads.h"
|
||||
#include "display/window_download_list.h"
|
||||
|
||||
#include "engine/poll.h"
|
||||
#include "engine/curl_stack.h"
|
||||
#include "engine/curl_get.h"
|
||||
#include "engine/downloads.h"
|
||||
#include "engine/download_list.h"
|
||||
|
||||
#include "input/bindings.h"
|
||||
#include "input/manager.h"
|
||||
@@ -21,29 +18,32 @@
|
||||
int main(int argc, char** argv) {
|
||||
try {
|
||||
|
||||
engine::Poll poll;
|
||||
engine::Downloads downloads;
|
||||
engine::CurlStack curlStack;
|
||||
|
||||
display::Canvas::init();
|
||||
|
||||
engine::Poll poll;
|
||||
engine::DownloadList downloads;
|
||||
|
||||
display::Manager display;
|
||||
|
||||
input::Manager inputManager;
|
||||
|
||||
inputManager.push_back(new input::Bindings);
|
||||
|
||||
poll.slot_read_stdin(sigc::mem_fun(inputManager, &input::Manager::pressed));
|
||||
poll.register_http();
|
||||
|
||||
display.push_back(new display::WindowDownloads(&downloads));
|
||||
display.push_back(new display::WindowDownloadList(&downloads));
|
||||
|
||||
torrent::initialize();
|
||||
torrent::listen_open(6880, 6999);
|
||||
|
||||
torrent::Http::set_factory(sigc::bind(sigc::ptr_fun(&engine::CurlGet::new_object), &curlStack));
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
std::fstream f(argv[i], std::ios::in);
|
||||
|
||||
downloads.create(f);
|
||||
engine::DownloadList::iterator itr = downloads.create(f);
|
||||
|
||||
itr->open();
|
||||
itr->hash_check();
|
||||
}
|
||||
|
||||
while (poll.is_running()) {
|
||||
|
||||
Reference in New Issue
Block a user