saves statistics from the last second from peer connections that are disconnected. Partly fixes #339
This commit is contained in:
parent
70fb14e11c
commit
c883f4475c
|
@ -180,6 +180,7 @@ namespace libtorrent
|
||||||
std::string name() const;
|
std::string name() const;
|
||||||
|
|
||||||
stat statistics() const { return m_stat; }
|
stat statistics() const { return m_stat; }
|
||||||
|
void add_stats(stat const& s) { m_stat += s; }
|
||||||
size_type bytes_left() const;
|
size_type bytes_left() const;
|
||||||
boost::tuples::tuple<size_type, size_type> bytes_done() const;
|
boost::tuples::tuple<size_type, size_type> bytes_done() const;
|
||||||
size_type quantized_bytes_done() const;
|
size_type quantized_bytes_done() const;
|
||||||
|
|
|
@ -2218,6 +2218,10 @@ namespace libtorrent
|
||||||
|
|
||||||
if (t)
|
if (t)
|
||||||
{
|
{
|
||||||
|
// make sure we keep all the stats!
|
||||||
|
calc_ip_overhead();
|
||||||
|
t->add_stats(statistics());
|
||||||
|
|
||||||
if (t->has_picker())
|
if (t->has_picker())
|
||||||
{
|
{
|
||||||
piece_picker& picker = t->picker();
|
piece_picker& picker = t->picker();
|
||||||
|
|
Loading…
Reference in New Issue