Added option and flag parseing, now supports -p for port range.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@287 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-02-18 19:08:17 +00:00
parent 78d3d78ef3
commit e0f21cce78
7 changed files with 142 additions and 10 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ Manager::initialize() {
CurlStack::init();
torrent::initialize();
torrent::listen_open(10000, 20000);
torrent::listen_open(m_portFirst, m_portLast);
}
void
+11 -4
View File
@@ -13,11 +13,13 @@ public:
typedef sigc::slot1<void, DownloadList::iterator> SlotReady;
typedef sigc::slot0<void> SlotFailed;
DownloadList& get_download_list() { return m_downloadList; }
HashQueue& get_hash_queue() { return m_hashQueue; }
HttpQueue& get_http_queue() { return m_httpQueue; }
Manager() : m_portFirst(6890), m_portLast(6999) {}
Poll& get_poll() { return m_poll; }
DownloadList& get_download_list() { return m_downloadList; }
HashQueue& get_hash_queue() { return m_hashQueue; }
HttpQueue& get_http_queue() { return m_httpQueue; }
Poll& get_poll() { return m_poll; }
void initialize();
void cleanup();
@@ -28,6 +30,8 @@ public:
void start(Download* d);
void stop(Download* d);
void set_port_range(int a, int b) { m_portFirst = a; m_portLast = b; }
private:
void receive_http_done(CurlGet* http);
@@ -38,6 +42,9 @@ private:
HashQueue m_hashQueue;
HttpQueue m_httpQueue;
Poll m_poll;
int m_portFirst;
int m_portLast;
};
}