mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-18 08:02:29 +00:00
Added -t for dumping tracker requests.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@315 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
Options and flags:
|
||||
|
||||
-p <a-b> Open a port in the range a to b.
|
||||
-i <a.b.c.d> Set the IP address sent to the tracker.
|
||||
|
||||
-s <dir> Use <dir> as the session directory. The torrents will be
|
||||
saved with the info-hash in hex as the filename.
|
||||
-p <a-b> Open a port in the range a to b.
|
||||
|
||||
-s <dir> Use <dir> as the session directory. The torrents will be
|
||||
saved with the info-hash in hex as the filename.
|
||||
|
||||
All:
|
||||
|
||||
Ctrl-Q - Quit
|
||||
Ctrl-Q - Quit
|
||||
|
||||
A - Increase Throttle by 1 KiB
|
||||
Z - Decrease Throttle by 1 KiB
|
||||
A - Increase Throttle by 1 KiB
|
||||
Z - Decrease Throttle by 1 KiB
|
||||
|
||||
S - Increase Throttle by 5 KiB
|
||||
X - Decrease Throttle by 5 KiB
|
||||
S - Increase Throttle by 5 KiB
|
||||
X - Decrease Throttle by 5 KiB
|
||||
|
||||
D - Increase Throttle by 50 KiB
|
||||
C - Decrease Throttle by 50 KiB
|
||||
D - Increase Throttle by 50 KiB
|
||||
C - Decrease Throttle by 50 KiB
|
||||
|
||||
|
||||
In main window:
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
AC_INIT(rtorrent, 0.0.3, jaris@ifi.uio.no)
|
||||
AC_INIT(rtorrent, 0.1.1, jaris@ifi.uio.no)
|
||||
|
||||
AM_INIT_AUTOMAKE
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
@@ -39,7 +39,7 @@ TORRENT_CHECK_EXECINFO()
|
||||
TORRENT_CHECK_CURL()
|
||||
TORRENT_OTFD()
|
||||
|
||||
PKG_CHECK_MODULES(STUFF, sigc++-2.0 libtorrent >= 0.4.11,
|
||||
PKG_CHECK_MODULES(STUFF, sigc++-2.0 libtorrent >= 0.5.0,
|
||||
CXXFLAGS="$CXXFLAGS $STUFF_CFLAGS $CURL_CFLAGS";
|
||||
LIBS="$LIBS $STUFF_LIBS $CURL_LIBS")
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "download.h"
|
||||
|
||||
#include <sigc++/bind.h>
|
||||
#include <sigc++/hide.h>
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
namespace core {
|
||||
@@ -11,7 +12,7 @@ void
|
||||
Download::set_download(torrent::Download d) {
|
||||
m_download = d;
|
||||
|
||||
m_connTrackerSucceded = m_download.signal_tracker_succeded(sigc::bind(sigc::mem_fun(*this, &Download::receive_tracker_msg), ""));
|
||||
m_connTrackerSucceded = m_download.signal_tracker_succeded(sigc::hide(sigc::bind(sigc::mem_fun(*this, &Download::receive_tracker_msg), "")));
|
||||
m_connTrackerFailed = m_download.signal_tracker_failed(sigc::mem_fun(*this, &Download::receive_tracker_msg));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include <fstream>
|
||||
#include <istream>
|
||||
#include <sstream>
|
||||
#include <iterator>
|
||||
#include <sigc++/bind.h>
|
||||
#include <torrent/bencode.h>
|
||||
#include <torrent/exceptions.h>
|
||||
#include <torrent/torrent.h>
|
||||
|
||||
@@ -138,7 +140,23 @@ Manager::create_final(std::istream* s) {
|
||||
start(*itr);
|
||||
m_downloadStore.save(*itr);
|
||||
|
||||
if (m_debugTracker >= 0)
|
||||
(*itr)->get_download().signal_tracker_succeded(sigc::mem_fun(*this, &Manager::receive_debug_tracker));
|
||||
|
||||
return itr;
|
||||
}
|
||||
|
||||
void
|
||||
Manager::receive_debug_tracker(torrent::Bencode& bencode) {
|
||||
std::stringstream filename;
|
||||
filename << "./tracker_dump." << m_debugTracker++;
|
||||
|
||||
std::fstream out(filename.str().c_str(), std::ios::out | std::ios::trunc);
|
||||
|
||||
if (!out.good())
|
||||
return;
|
||||
|
||||
out << bencode;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+11
-1
@@ -8,6 +8,10 @@
|
||||
#include "poll.h"
|
||||
#include "log.h"
|
||||
|
||||
namespace torrent {
|
||||
class Bencode;
|
||||
}
|
||||
|
||||
namespace core {
|
||||
|
||||
class Manager {
|
||||
@@ -16,7 +20,7 @@ public:
|
||||
typedef sigc::slot1<void, DownloadList::iterator> SlotReady;
|
||||
typedef sigc::slot0<void> SlotFailed;
|
||||
|
||||
Manager() : m_portFirst(6890), m_portLast(6999) {}
|
||||
Manager() : m_portFirst(6890), m_portLast(6999), m_debugTracker(-1) {}
|
||||
|
||||
DownloadList& get_download_list() { return m_downloadList; }
|
||||
DownloadStore& get_download_store() { return m_downloadStore; }
|
||||
@@ -40,6 +44,8 @@ public:
|
||||
|
||||
void set_port_range(int a, int b) { m_portFirst = a; m_portLast = b; }
|
||||
|
||||
void debug_tracker() { m_debugTracker = 0; }
|
||||
|
||||
private:
|
||||
void receive_http_done(CurlGet* http);
|
||||
void receive_http_failed(std::string msg);
|
||||
@@ -49,6 +55,8 @@ private:
|
||||
|
||||
iterator create_final(std::istream* s);
|
||||
|
||||
void receive_debug_tracker(torrent::Bencode& bencode);
|
||||
|
||||
DownloadList m_downloadList;
|
||||
DownloadStore m_downloadStore;
|
||||
HashQueue m_hashQueue;
|
||||
@@ -60,6 +68,8 @@ private:
|
||||
std::string m_dns;
|
||||
int m_portFirst;
|
||||
int m_portLast;
|
||||
|
||||
int m_debugTracker;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ WindowLog::~WindowLog() {
|
||||
|
||||
WindowLog::iterator
|
||||
WindowLog::find_older() {
|
||||
return m_log->find_older(utils::Timer::cache() - 10*1000000);
|
||||
return m_log->find_older(utils::Timer::cache() - 60*1000000);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -81,6 +81,8 @@ parse_options(ui::Control* c, int argc, char** argv) {
|
||||
sigc::mem_fun(c->get_core(), &core::Manager::set_port_range)));
|
||||
optionParser.insert_option('s', sigc::mem_fun(c->get_core().get_download_store(), &core::DownloadStore::activate));
|
||||
|
||||
optionParser.insert_flag('t', sigc::mem_fun(c->get_core(), &core::Manager::debug_tracker));
|
||||
|
||||
return optionParser.process(argc, argv);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ Directory::update() {
|
||||
Base::push_back(ent->d_name);
|
||||
}
|
||||
|
||||
closedir(d);
|
||||
Base::sort(std::less<std::string>());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user