|
|
@ -508,7 +508,6 @@ Session::Session(QObject *parent) |
|
|
|
new PortForwarderImpl {m_nativeSession}; |
|
|
|
new PortForwarderImpl {m_nativeSession}; |
|
|
|
|
|
|
|
|
|
|
|
initMetrics(); |
|
|
|
initMetrics(); |
|
|
|
m_statsUpdateTimer.start(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qDebug("* BitTorrent Session constructed"); |
|
|
|
qDebug("* BitTorrent Session constructed"); |
|
|
|
} |
|
|
|
} |
|
|
@ -4207,7 +4206,9 @@ void Session::handleExternalIPAlert(const lt::external_ip_alert *p) |
|
|
|
|
|
|
|
|
|
|
|
void Session::handleSessionStatsAlert(const lt::session_stats_alert *p) |
|
|
|
void Session::handleSessionStatsAlert(const lt::session_stats_alert *p) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const qreal interval = m_statsUpdateTimer.restart() / 1000.; |
|
|
|
const qreal interval = lt::total_milliseconds(p->timestamp() - m_statsLastTimestamp) / 1000.; |
|
|
|
|
|
|
|
m_statsLastTimestamp = p->timestamp(); |
|
|
|
|
|
|
|
|
|
|
|
#if (LIBTORRENT_VERSION_NUM < 10200) |
|
|
|
#if (LIBTORRENT_VERSION_NUM < 10200) |
|
|
|
const auto &stats = p->values; |
|
|
|
const auto &stats = p->values; |
|
|
|
#else |
|
|
|
#else |
|
|
|