mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-07 14:49:21 +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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user