added feature to not count downloaded bytes from web seeds in stats

This commit is contained in:
Arvid Norberg
2010-07-15 06:27:44 +00:00
parent 89ca5a157a
commit 4c6be42b74
8 changed files with 39 additions and 2 deletions

View File

@@ -1253,6 +1253,19 @@ namespace aux {
// if anonymous mode was enabled, clear out the peer ID
bool anonymous = (m_settings.anonymous_mode != s.anonymous_mode && s.anonymous_mode);
if (m_settings.report_web_seed_downloads != s.report_web_seed_downloads)
{
// if this flag changed, update all web seed connections
for (connection_map::iterator i = m_connections.begin()
, end(m_connections.end()); i != end; ++i)
{
int type = (*i)->type();
if (type == peer_connection::url_seed_connection
|| type == peer_connection::http_seed_connection)
(*i)->ignore_stats(!s.report_web_seed_downloads);
}
}
m_settings = s;
// enable anonymous mode. We don't want to accept any incoming