mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-13 20:56:17 +00:00
Switched from tracker dump in bencode to std::istream*.
Various *BSD port fixes. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@406 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+6
-3
@@ -186,16 +186,19 @@ Manager::create_final(std::istream* s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Manager::receive_debug_tracker(torrent::Bencode& bencode) {
|
Manager::receive_debug_tracker(std::istream* s) {
|
||||||
std::stringstream filename;
|
std::stringstream filename;
|
||||||
filename << "./tracker_dump." << m_debugTracker++;
|
filename << "./tracker_dump." << m_debugTracker++;
|
||||||
|
|
||||||
std::fstream out(filename.str().c_str(), std::ios::out | std::ios::trunc);
|
std::fstream out(filename.str().c_str(), std::ios::out | std::ios::trunc);
|
||||||
|
|
||||||
if (!out.good())
|
if (!out.is_open())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
s->seekg(0);
|
||||||
|
|
||||||
out << bencode;
|
std::copy(std::istream_iterator<char>(*s), std::istream_iterator<char>(),
|
||||||
|
std::ostream_iterator<char>(out));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -23,6 +23,8 @@
|
|||||||
#ifndef RTORRENT_CORE_MANAGER_H
|
#ifndef RTORRENT_CORE_MANAGER_H
|
||||||
#define RTORRENT_CORE_MANAGER_H
|
#define RTORRENT_CORE_MANAGER_H
|
||||||
|
|
||||||
|
#include <iosfwd>
|
||||||
|
|
||||||
#include "download_list.h"
|
#include "download_list.h"
|
||||||
#include "download_store.h"
|
#include "download_store.h"
|
||||||
#include "hash_queue.h"
|
#include "hash_queue.h"
|
||||||
@@ -81,7 +83,7 @@ private:
|
|||||||
|
|
||||||
iterator create_final(std::istream* s);
|
iterator create_final(std::istream* s);
|
||||||
|
|
||||||
void receive_debug_tracker(torrent::Bencode& bencode);
|
void receive_debug_tracker(std::istream* s);
|
||||||
|
|
||||||
DownloadList m_downloadList;
|
DownloadList m_downloadList;
|
||||||
DownloadStore m_downloadStore;
|
DownloadStore m_downloadStore;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <ncurses.h>
|
#include <ncurses.h>
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ print_download_status(core::Download* d) {
|
|||||||
|
|
||||||
std::string
|
std::string
|
||||||
print_hhmmss(utils::Timer t) {
|
print_hhmmss(utils::Timer t) {
|
||||||
std::tm *u = std::localtime(&(time_t)t.tval().tv_sec);
|
time_t tv_sec = static_cast<time_t>(t.tval().tv_sec);
|
||||||
|
std::tm *u = std::localtime(&tv_sec);
|
||||||
|
|
||||||
if (u == NULL)
|
if (u == NULL)
|
||||||
return "inv_time";
|
return "inv_time";
|
||||||
|
|||||||
Reference in New Issue
Block a user