saves statistics from the last second from peer connections that are disconnected. Partly fixes #339

This commit is contained in:
Arvid Norberg 2008-06-03 05:21:00 +00:00
parent 70fb14e11c
commit c883f4475c
2 changed files with 5 additions and 0 deletions

View File

@ -180,6 +180,7 @@ namespace libtorrent
std::string name() const;
stat statistics() const { return m_stat; }
void add_stats(stat const& s) { m_stat += s; }
size_type bytes_left() const;
boost::tuples::tuple<size_type, size_type> bytes_done() const;
size_type quantized_bytes_done() const;

View File

@ -2218,6 +2218,10 @@ namespace libtorrent
if (t)
{
// make sure we keep all the stats!
calc_ip_overhead();
t->add_stats(statistics());
if (t->has_picker())
{
piece_picker& picker = t->picker();