diff --git a/docs/todo.html b/docs/todo.html index f572dd196..7c32d0661 100644 --- a/docs/todo.html +++ b/docs/todo.html @@ -21,7 +21,7 @@

libtorrent todo-list

-2 urgent +1 urgent 18 important 23 relevant 9 feasible @@ -81,61 +81,7 @@ do as well with NATs)

../src/session_impl.cpp:482

relevance 4../src/torrent.cpp:9627this logic doesn't work for seeding torrents that are not ticked once a torrent is inactive, it may not be ticked anymore, which may prevent it from ever have m_inactive be set, because there's a delay deom becoming inactive and trigger auto-manage.

this logic doesn't work for seeding torrents that are not ticked -once a torrent is inactive, it may not be ticked anymore, which may -prevent it from ever have m_inactive be set, because there's a delay -deom becoming inactive and trigger auto-manage.

../src/torrent.cpp:9627

			{
-				i = m_connections.begin() + idx;
-				--idx;
-			}
-		}
-		if (m_ses.alerts().should_post<stats_alert>())
-			m_ses.alerts().post_alert(stats_alert(get_handle(), tick_interval_ms, m_stat));
-
-		m_total_uploaded += m_stat.last_payload_uploaded();
-		m_total_downloaded += m_stat.last_payload_downloaded();
-		m_stat.second_tick(tick_interval_ms);
-
-		// these counters are saved in the resume data, since they updated
-		// we need to save the resume data too
-		m_need_save_resume_data = true;
-
-		// if the rate is 0, there's no update because of network transfers
-		if (m_stat.low_pass_upload_rate() > 0 || m_stat.low_pass_download_rate() > 0)
-			state_updated();
-
-
-
// this section determines whether the torrent is active or not. When it - // changes state, it may also trigger the auto-manage logic to reconsider - // which torrents should be queued and started. There is a low pass - // filter in order to avoid flapping (auto_manage_startup). - bool is_inactive = false; - if (is_finished()) - is_inactive = m_stat.upload_payload_rate() < m_ses.settings().get_int(settings_pack::inactive_up_rate); - else - is_inactive = m_stat.download_payload_rate() < m_ses.settings().get_int(settings_pack::inactive_down_rate); - - if (is_inactive) - { - if (m_inactive_counter < 0) m_inactive_counter = 0; - if (m_inactive_counter < INT16_MAX) - { - ++m_inactive_counter; - - // if this torrent was just considered inactive, we may want - // to dequeue some other torrent - if (m_inactive == false - && m_inactive_counter >= m_ses.settings().get_int(settings_pack::auto_manage_startup)) - { - m_inactive = true; - if (m_ses.settings().get_bool(settings_pack::dont_count_slow_torrents)) - m_ses.trigger_auto_manage(); - } - } - } - else - { -
relevance 3../test/test_dht.cpp:436test obfuscated_get_peers

test obfuscated_get_peers

../test/test_dht.cpp:436

	g_got_peers.insert(g_got_peers.end(), peers.begin(), peers.end());
+
relevance 3../test/test_dht.cpp:436test obfuscated_get_peers

test obfuscated_get_peers

../test/test_dht.cpp:436

	g_got_peers.insert(g_got_peers.end(), peers.begin(), peers.end());
 }
 
 std::vector<dht::item> g_got_items;
@@ -186,7 +132,7 @@ bool get_item_cb(dht::item& i)
 
 	fprintf(stderr, "msg: %s\n", print_entry(response).c_str());
 	ret = dht::verify_message(&response, pong_desc, parsed, 4, error_string, sizeof(error_string));
-
relevance 3../test/test_transfer.cpp:284factor out the disk-full test into its own unit test

factor out the disk-full test into its own unit test

../test/test_transfer.cpp:284

		print_alerts(ses1, "ses1", true, true, true, &on_alert);
+
relevance 3../test/test_transfer.cpp:284factor out the disk-full test into its own unit test

factor out the disk-full test into its own unit test

../test/test_transfer.cpp:284

		print_alerts(ses1, "ses1", true, true, true, &on_alert);
 		print_alerts(ses2, "ses2", true, true, true, &on_alert);
 
 		if (i % 10 == 0)
@@ -237,7 +183,7 @@ bool get_item_cb(dht::item& i)
 			fprintf(stderr, "%s: discovered disk full mode. Raise limit and disable upload-mode\n", time_now_string());
 			peer_disconnects = 0;
 			continue;
-
relevance 3../src/disk_io_thread.cpp:242it would be nice to have the number of threads be set dynamically

it would be nice to have the number of threads be set dynamically

../src/disk_io_thread.cpp:242

		std::pair<block_cache::iterator, block_cache::iterator> pieces
+
relevance 3../src/disk_io_thread.cpp:242it would be nice to have the number of threads be set dynamically

it would be nice to have the number of threads be set dynamically

../src/disk_io_thread.cpp:242

		std::pair<block_cache::iterator, block_cache::iterator> pieces
 			= m_disk_cache.all_pieces();
 		TORRENT_ASSERT(pieces.first == pieces.second);
 #endif
@@ -288,7 +234,7 @@ bool get_item_cb(dht::item& i)
 			m_threads.resize(m_num_threads);
 		}
 	}
-
relevance 3../src/peer_connection.cpp:1850we should probably use ses.m_allowed_upload_slots here instead to work with auto-unchoke logic

we should probably use ses.m_allowed_upload_slots here instead +

relevance 3../src/peer_connection.cpp:1850we should probably use ses.m_allowed_upload_slots here instead to work with auto-unchoke logic

we should probably use ses.m_allowed_upload_slots here instead to work with auto-unchoke logic

../src/peer_connection.cpp:1850

#endif
 			write_unchoke();
 			return;
@@ -340,7 +286,7 @@ to work with auto-unchoke logic

../src/peer_connection.cpp:1850

relevance 3../src/peer_connection.cpp:3187since we throw away the queue entry once we issue the disk job, this may happen. Instead, we should keep the queue entry around, mark it as having been requested from disk and once the disk job comes back, discard it if it has been cancelled. Maybe even be able to cancel disk jobs?

since we throw away the queue entry once we issue +

relevance 3../src/peer_connection.cpp:3187since we throw away the queue entry once we issue the disk job, this may happen. Instead, we should keep the queue entry around, mark it as having been requested from disk and once the disk job comes back, discard it if it has been cancelled. Maybe even be able to cancel disk jobs?

since we throw away the queue entry once we issue the disk job, this may happen. Instead, we should keep the queue entry around, mark it as having been requested from disk and once the disk job comes back, discard it if it has @@ -395,7 +341,7 @@ been cancelled. Maybe even be able to cancel disk jobs?

../src/peer_conn void peer_connection::incoming_have_all() { TORRENT_ASSERT(is_single_thread()); -

relevance 3../src/peer_connection.cpp:4919instead of using settings_pack::request_timeout, use m_rtt.mean() + m_rtt.avg_deviation() * 2 or something like that. the configuration option could hopefully be removed

instead of using settings_pack::request_timeout, use +relevance 3../src/peer_connection.cpp:4919instead of using settings_pack::request_timeout, use m_rtt.mean() + m_rtt.avg_deviation() * 2 or something like that. the configuration option could hopefully be removed

instead of using settings_pack::request_timeout, use m_rtt.mean() + m_rtt.avg_deviation() * 2 or something like that. the configuration option could hopefully be removed

../src/peer_connection.cpp:4919

		// don't bother disconnect peers we haven't been interested
 		// in (and that hasn't been interested in us) for a while
@@ -448,7 +394,7 @@ the configuration option could hopefully be removed

../src/peer_connecti if (m_desired_queue_size == m_max_out_request_queue && t->alerts().should_post<performance_alert>()) { -

relevance 3../src/piece_picker.cpp:3166it would be nice if this could be folded into lock_piece() the main distinction is that this also maintains the m_num_passed counter and the passed_hash_check member

it would be nice if this could be folded into lock_piece() +relevance 3../src/piece_picker.cpp:3166it would be nice if this could be folded into lock_piece() the main distinction is that this also maintains the m_num_passed counter and the passed_hash_check member

it would be nice if this could be folded into lock_piece() the main distinction is that this also maintains the m_num_passed counter and the passed_hash_check member

../src/piece_picker.cpp:3166

		int state = m_piece_map[piece].state;
 		if (state == piece_pos::piece_open) return;
@@ -501,7 +447,7 @@ counter and the passed_hash_check member

../src/piece_picker.cpp:3166relevance 3../src/resolver.cpp:39the first places to use this resolver is the http_connection/http_tracker_connection and udp_tracker_connection. make sure to prefer cache on shutdown

the first places to use this resolver is the +

relevance 3../src/resolver.cpp:39the first places to use this resolver is the http_connection/http_tracker_connection and udp_tracker_connection. make sure to prefer cache on shutdown

the first places to use this resolver is the http_connection/http_tracker_connection and udp_tracker_connection. make sure to prefer cache on shutdown

../src/resolver.cpp:39

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -554,7 +500,7 @@ namespace libtorrent
 		}
 
 		h(ec, ce.addresses);
-
relevance 3../src/session_impl.cpp:5445it would be really nice to update these counters as they are incremented. This depends on the session being ticked, which has a fairly coarse grained resolution

it would be really nice to update these counters +relevance 3../src/session_impl.cpp:5445it would be really nice to update these counters as they are incremented. This depends on the session being ticked, which has a fairly coarse grained resolution

it would be really nice to update these counters as they are incremented. This depends on the session being ticked, which has a fairly coarse grained resolution

../src/session_impl.cpp:5445

			t->status(&alert->status.back(), ~torrent_handle::query_accurate_download_counters);
 			t->clear_in_state_update();
@@ -607,8 +553,8 @@ being ticked, which has a fairly coarse grained resolution

../src/sessio for (int i = 0; i < counters::num_counters; ++i) values[i] = m_stats_counters[i]; -

relevance 3../src/session_impl.cpp:6898If socket jobs could be higher level, to include RC4 encryption and decryption, we would offload the main thread even more

If socket jobs could be higher level, to include RC4 encryption and decryption, -we would offload the main thread even more

../src/session_impl.cpp:6898

	{
+
relevance 3../src/session_impl.cpp:6908If socket jobs could be higher level, to include RC4 encryption and decryption, we would offload the main thread even more

If socket jobs could be higher level, to include RC4 encryption and decryption, +we would offload the main thread even more

../src/session_impl.cpp:6908

	{
 		int num_threads = m_settings.get_int(settings_pack::network_threads);
 		int num_pools = num_threads > 0 ? num_threads : 1;
 		while (num_pools > m_net_thread_pool.size())
@@ -659,7 +605,7 @@ we would offload the main thread even more

../src/session_impl.cpp:6898< , end(m_connections.end()); i != end; ++i) { int type = (*i)->type(); -

relevance 3../src/torrent.cpp:1083if any other peer has a busy request to this block, we need to cancel it too

if any other peer has a busy request to this block, we need to cancel it too

../src/torrent.cpp:1083

#endif
+
relevance 3../src/torrent.cpp:1083if any other peer has a busy request to this block, we need to cancel it too

if any other peer has a busy request to this block, we need to cancel it too

../src/torrent.cpp:1083

#endif
 
 		TORRENT_ASSERT(j->piece >= 0);
 
@@ -710,7 +656,7 @@ we would offload the main thread even more

../src/session_impl.cpp:6898< alerts().post_alert(file_error_alert(j->error.ec , resolve_filename(j->error.file), j->error.operation_str(), get_handle())); if (c) c->disconnect(errors::no_memory, peer_connection_interface::op_file); -

relevance 3../src/torrent.cpp:7665if peer is a really good peer, maybe we shouldn't disconnect it

if peer is a really good peer, maybe we shouldn't disconnect it

../src/torrent.cpp:7665

#if defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
+
relevance 3../src/torrent.cpp:7666if peer is a really good peer, maybe we shouldn't disconnect it

if peer is a really good peer, maybe we shouldn't disconnect it

../src/torrent.cpp:7666

#if defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
 		debug_log("incoming peer (%d)", int(m_connections.size()));
 #endif
 
@@ -761,7 +707,7 @@ we would offload the main thread even more

../src/session_impl.cpp:6898< if (m_abort) return false; if (!m_connections.empty()) return true; -

relevance 3../src/web_peer_connection.cpp:596just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the following

just make this peer not have the pieces +relevance 3../src/web_peer_connection.cpp:596just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the following

just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the following

../src/web_peer_connection.cpp:596

		{
 			++m_num_responses;
@@ -814,7 +760,7 @@ when it doesn't have any of the file do the following

../src/web_peer_co { // we should not try this server again. t->remove_web_seed(this, errors::missing_location, op_bittorrent, 2); -

relevance 3../include/libtorrent/block_cache.hpp:209could this be a scoped_array instead? does cached_piece_entry really need to be copyable? cached_piece_entry does need to be copyable since it's part of a container, but it's possible it could be a raw pointer or boost::unique_ptr perhaps

could this be a scoped_array instead? does cached_piece_entry +relevance 3../include/libtorrent/block_cache.hpp:209could this be a scoped_array instead? does cached_piece_entry really need to be copyable? cached_piece_entry does need to be copyable since it's part of a container, but it's possible it could be a raw pointer or boost::unique_ptr perhaps

could this be a scoped_array instead? does cached_piece_entry really need to be copyable? cached_piece_entry does need to be copyable since it's part of a container, but it's possible it could be a raw pointer or boost::unique_ptr perhaps

../include/libtorrent/block_cache.hpp:209

		tailqueue read_jobs;
@@ -842,7 +788,7 @@ a raw pointer or boost::unique_ptr perhaps

../include/libtorrent/block_c // the last time a block was written to this piece // plus the minimum amount of time the block is guaranteed // to stay in the cache -

relevance 3../include/libtorrent/disk_io_thread.hpp:537turn these counters and gauges into session_stats counters (which also would need to be thread safe)

turn these counters and gauges into session_stats +relevance 3../include/libtorrent/disk_io_thread.hpp:537turn these counters and gauges into session_stats counters (which also would need to be thread safe)

turn these counters and gauges into session_stats counters (which also would need to be thread safe)

../include/libtorrent/disk_io_thread.hpp:537

		void* m_userdata;
 
 		// the last time we expired write blocks from the cache
@@ -894,7 +840,7 @@ counters (which also would need to be thread safe)

../include/libtorrent // when it's OK to exit the main loop of the disk thread boost::atomic<int> m_num_blocked_jobs; -

relevance 3../include/libtorrent/policy.hpp:104this class should be renamed peer_list

this class should be renamed peer_list

../include/libtorrent/policy.hpp:104

		int min_reconnect_time;
+
relevance 3../include/libtorrent/policy.hpp:104this class should be renamed peer_list

this class should be renamed peer_list

../include/libtorrent/policy.hpp:104

		int min_reconnect_time;
 
 		// the number of iterations over the peer list for this operation
 		int loop_counter;
@@ -945,7 +891,7 @@ counters (which also would need to be thread safe)

../include/libtorrent // called when an incoming connection is accepted // false means the connection was refused or failed -

relevance 3../include/libtorrent/session.hpp:210could the fingerprint be a setting as well? And should the settings_pack be optional?

could the fingerprint be a setting as well? And should the +relevance 3../include/libtorrent/session.hpp:210could the fingerprint be a setting as well? And should the settings_pack be optional?

could the fingerprint be a setting as well? And should the settings_pack be optional?

../include/libtorrent/session.hpp:210

	// 
 	// see apply_settings().
 	class TORRENT_EXPORT session: public boost::noncopyable
@@ -997,7 +943,7 @@ settings_pack be optional?

../include/libtorrent/session.hpp:210

relevance 3../include/libtorrent/torrent_info.hpp:221this type should be different from the one used by torrent. It should not include internal state.

this type should be different from the one used by torrent. It +

relevance 3../include/libtorrent/torrent_info.hpp:221this type should be different from the one used by torrent. It should not include internal state.

this type should be different from the one used by torrent. It should not include internal state.

../include/libtorrent/torrent_info.hpp:221

				&& !updating;
 		}
 #endif
@@ -1049,7 +995,7 @@ should not include internal state.

../include/libtorrent/torrent_info.hp // The URL of the web seed std::string url; -

relevance 2../src/disk_io_thread.cpp:844should this be allocated on the stack?

should this be allocated on the stack?

../src/disk_io_thread.cpp:844

			// if we're also flushing the read cache, this piece
+
relevance 2../src/disk_io_thread.cpp:844should this be allocated on the stack?

should this be allocated on the stack?

../src/disk_io_thread.cpp:844

			// if we're also flushing the read cache, this piece
 			// should be removed as soon as all write jobs finishes
 			// otherwise it will turn into a read piece
 		}
@@ -1100,7 +1046,7 @@ should not include internal state.

../include/libtorrent/torrent_info.hp { cached_piece_entry* pe = m_disk_cache.find_piece(storage, (*i)->piece); TORRENT_PIECE_ASSERT(pe->num_dirty == 0, pe); -

relevance 2../src/disk_io_thread.cpp:885we're not flushing the read cache at all?

we're not flushing the read cache at all?

../src/disk_io_thread.cpp:885

			// from disk_io_thread::do_delete, which is a fence job and should
+
relevance 2../src/disk_io_thread.cpp:885we're not flushing the read cache at all?

we're not flushing the read cache at all?

../src/disk_io_thread.cpp:885

			// from disk_io_thread::do_delete, which is a fence job and should
 			// have any other jobs active, i.e. there should not be any references
 			// keeping pieces or blocks alive
 			if ((flags & flush_delete_cache) && (flags & flush_expect_clear))
@@ -1151,7 +1097,7 @@ should not include internal state.

../include/libtorrent/torrent_info.hp if (e->num_dirty == 0) continue; pieces.push_back(std::make_pair(e->storage.get(), int(e->piece))); } -

relevance 2../src/file.cpp:1491use vm_copy here, if available, and if buffers are aligned

use vm_copy here, if available, and if buffers are aligned

../src/file.cpp:1491

		CloseHandle(native_handle());
+
relevance 2../src/file.cpp:1491use vm_copy here, if available, and if buffers are aligned

use vm_copy here, if available, and if buffers are aligned

../src/file.cpp:1491

		CloseHandle(native_handle());
 		m_path.clear();
 #else
 		if (m_file_handle != INVALID_HANDLE_VALUE)
@@ -1181,7 +1127,7 @@ should not include internal state.

../include/libtorrent/torrent_info.hp int offset = 0; for (int i = 0; i < num_bufs; ++i) { -

relevance 2../src/file.cpp:1502use vm_copy here, if available, and if buffers are aligned

use vm_copy here, if available, and if buffers are aligned

../src/file.cpp:1502

	}
+
relevance 2../src/file.cpp:1502use vm_copy here, if available, and if buffers are aligned

use vm_copy here, if available, and if buffers are aligned

../src/file.cpp:1502

	}
 
 	// defined in storage.cpp
 	int bufs_size(file::iovec_t const* bufs, int num_bufs);
@@ -1232,7 +1178,7 @@ should not include internal state.

../include/libtorrent/torrent_info.hp // issue a single write operation instead of using a vector // operation int buf_size = 0; -

relevance 2../src/peer_connection.cpp:4841use a deadline_timer for timeouts. Don't rely on second_tick()! Hook this up to connect timeout as well. This would improve performance because of less work in second_tick(), and might let use remove ticking entirely eventually

use a deadline_timer for timeouts. Don't rely on second_tick()! +relevance 2../src/peer_connection.cpp:4841use a deadline_timer for timeouts. Don't rely on second_tick()! Hook this up to connect timeout as well. This would improve performance because of less work in second_tick(), and might let use remove ticking entirely eventually

use a deadline_timer for timeouts. Don't rely on second_tick()! Hook this up to connect timeout as well. This would improve performance because of less work in second_tick(), and might let use remove ticking entirely eventually

../src/peer_connection.cpp:4841

			if (is_i2p(*m_socket))
@@ -1286,7 +1232,7 @@ entirely eventually

../src/peer_connection.cpp:4841

relevance 2../src/session_impl.cpp:2343use bind_to_device in udp_socket

use bind_to_device in udp_socket

../src/session_impl.cpp:2343

		if (m_listen_sockets.empty() && ec)
+
relevance 2../src/session_impl.cpp:2343use bind_to_device in udp_socket

use bind_to_device in udp_socket

../src/session_impl.cpp:2343

		if (m_listen_sockets.empty() && ec)
 		{
 #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
 			char msg[200];
@@ -1337,7 +1283,7 @@ entirely eventually

../src/peer_connection.cpp:4841

relevance 2../src/session_impl.cpp:4353make a list for torrents that want to be announced on the DHT so we don't have to loop over all torrents, just to find the ones that want to announce

make a list for torrents that want to be announced on the DHT so we +

relevance 2../src/session_impl.cpp:4353make a list for torrents that want to be announced on the DHT so we don't have to loop over all torrents, just to find the ones that want to announce

make a list for torrents that want to be announced on the DHT so we don't have to loop over all torrents, just to find the ones that want to announce

../src/session_impl.cpp:4353

		if (!m_dht_torrents.empty())
 		{
 			boost::shared_ptr<torrent> t;
@@ -1389,7 +1335,7 @@ don't have to loop over all torrents, just to find the ones that want to announc
 		if (m_torrents.empty()) return;
 
 		if (m_next_lsd_torrent == m_torrents.end())
-
relevance 2../src/torrent.cpp:701post alert

post alert

../src/torrent.cpp:701

		state_updated();
+
relevance 2../src/torrent.cpp:701post alert

post alert

../src/torrent.cpp:701

		state_updated();
 
 		set_state(torrent_status::downloading);
 
@@ -1440,8 +1386,8 @@ don't have to loop over all torrents, just to find the ones that want to announc
 		TORRENT_ASSERT(piece >= 0);
 		TORRENT_ASSERT(m_verified.get_bit(piece) == false);
 		++m_num_verified;
-
relevance 2../src/torrent.cpp:4691abort lookups this torrent has made via the session host resolver interface

abort lookups this torrent has made via the -session host resolver interface

../src/torrent.cpp:4691

		// files belonging to the torrents
+
relevance 2../src/torrent.cpp:4692abort lookups this torrent has made via the session host resolver interface

abort lookups this torrent has made via the +session host resolver interface

../src/torrent.cpp:4692

		// files belonging to the torrents
 		disconnect_all(errors::torrent_aborted, peer_connection_interface::op_bittorrent);
 
 		// post a message to the main thread to destruct
@@ -1492,7 +1438,7 @@ session host resolver interface

../src/torrent.cpp:4691

relevance 2../src/udp_tracker_connection.cpp:64it would be nice to not have a dependency on session_impl here

it would be nice to not have a dependency on session_impl here

../src/udp_tracker_connection.cpp:64

#pragma warning(pop)
+
relevance 2../src/udp_tracker_connection.cpp:64it would be nice to not have a dependency on session_impl here

it would be nice to not have a dependency on session_impl here

../src/udp_tracker_connection.cpp:64

#pragma warning(pop)
 #endif
 
 #include "libtorrent/tracker_manager.hpp"
@@ -1543,7 +1489,7 @@ namespace libtorrent
 
 		if (ec)
 		{
-
relevance 2../src/web_peer_connection.cpp:655create a mapping of file-index to redirection URLs. Use that to form URLs instead. Support to reconnect to a new server without destructing this peer_connection

create a mapping of file-index to redirection URLs. Use that to form +

relevance 2../src/web_peer_connection.cpp:655create a mapping of file-index to redirection URLs. Use that to form URLs instead. Support to reconnect to a new server without destructing this peer_connection

create a mapping of file-index to redirection URLs. Use that to form URLs instead. Support to reconnect to a new server without destructing this peer_connection

../src/web_peer_connection.cpp:655

						== dl_target);
 #endif
@@ -1596,7 +1542,7 @@ peer_connection

../src/web_peer_connection.cpp:655

relevance 2../src/kademlia/dos_blocker.cpp:75make these limits configurable

make these limits configurable

../src/kademlia/dos_blocker.cpp:75

	bool dos_blocker::incoming(address addr, ptime now)
+
relevance 2../src/kademlia/dos_blocker.cpp:75make these limits configurable

make these limits configurable

../src/kademlia/dos_blocker.cpp:75

	bool dos_blocker::incoming(address addr, ptime now)
 	{
 		node_ban_entry* match = 0;
 		node_ban_entry* min = m_ban_nodes;
@@ -1647,7 +1593,7 @@ peer_connection

../src/web_peer_connection.cpp:655

relevance 2../src/kademlia/node.cpp:67make this configurable in dht_settings

make this configurable in dht_settings

../src/kademlia/node.cpp:67

#include "libtorrent/kademlia/routing_table.hpp"
+
relevance 2../src/kademlia/node.cpp:67make this configurable in dht_settings

make this configurable in dht_settings

../src/kademlia/node.cpp:67

#include "libtorrent/kademlia/routing_table.hpp"
 #include "libtorrent/kademlia/node.hpp"
 #include "libtorrent/kademlia/dht_observer.hpp"
 
@@ -1698,7 +1644,7 @@ void purge_peers(std::set<peer_entry>& peers)
 
 void nop() {}
 
-
relevance 2../src/kademlia/node_id.cpp:133this could be optimized if SSE 4.2 is available. It could also be optimized given that we have a fixed length

this could be optimized if SSE 4.2 is +

relevance 2../src/kademlia/node_id.cpp:133this could be optimized if SSE 4.2 is available. It could also be optimized given that we have a fixed length

this could be optimized if SSE 4.2 is available. It could also be optimized given that we have a fixed length

../src/kademlia/node_id.cpp:133

		b6 = ip_.to_v6().to_bytes();
 		ip = &b6[0];
@@ -1751,7 +1697,7 @@ bool verify_id(node_id const& nid, address const& source_ip)
 	if (is_local(source_ip)) return true;
 
 	node_id h = generate_id_impl(source_ip, nid[19]);
-
relevance 2../include/libtorrent/enum_net.hpp:137this could be done more efficiently by just looking up the interface with the given name, maybe even with if_nametoindex()

this could be done more efficiently by just looking up +

relevance 2../include/libtorrent/enum_net.hpp:137this could be done more efficiently by just looking up the interface with the given name, maybe even with if_nametoindex()

this could be done more efficiently by just looking up the interface with the given name, maybe even with if_nametoindex()

../include/libtorrent/enum_net.hpp:137

 		address ip = address::from_string(device_name, ec);
 		if (!ec)
@@ -1803,7 +1749,7 @@ the interface with the given name, maybe even with if_nametoindex()

../i // returns true if the given device exists TORRENT_EXTRA_EXPORT bool has_interface(char const* name, io_service& ios -

relevance 2../include/libtorrent/intrusive_ptr_base.hpp:44remove this class and transition over to using shared_ptr and make_shared instead

remove this class and transition over to using shared_ptr and +

relevance 2../include/libtorrent/intrusive_ptr_base.hpp:44remove this class and transition over to using shared_ptr and make_shared instead

remove this class and transition over to using shared_ptr and make_shared instead

../include/libtorrent/intrusive_ptr_base.hpp:44

CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
@@ -1855,7 +1801,7 @@ namespace libtorrent
 
 		intrusive_ptr_base(): m_refs(0) {}
 
-
relevance 2../include/libtorrent/session_settings.hpp:53this type is only used internally now. move it to an internal header and make this type properly deprecated.

this type is only used internally now. move it to an internal +

relevance 2../include/libtorrent/session_settings.hpp:53this type is only used internally now. move it to an internal header and make this type properly deprecated.

this type is only used internally now. move it to an internal header and make this type properly deprecated.

../include/libtorrent/session_settings.hpp:53

#ifndef TORRENT_SESSION_SETTINGS_HPP_INCLUDED
 #define TORRENT_SESSION_SETTINGS_HPP_INCLUDED
 
@@ -1907,7 +1853,7 @@ namespace libtorrent
 			// ignored.
 			none,
 
-
relevance 2../include/libtorrent/settings_pack.hpp:70add an API to query a settings_pack as well

add an API to query a settings_pack as well

../include/libtorrent/settings_pack.hpp:70

relevance 2../include/libtorrent/settings_pack.hpp:71maybe convert all bool types into int-types as well

maybe convert all bool types into int-types as well

../include/libtorrent/settings_pack.hpp:71

{
+
relevance 2../include/libtorrent/settings_pack.hpp:70add an API to query a settings_pack as well

add an API to query a settings_pack as well

../include/libtorrent/settings_pack.hpp:70

relevance 2../include/libtorrent/settings_pack.hpp:71maybe convert all bool types into int-types as well

maybe convert all bool types into int-types as well

../include/libtorrent/settings_pack.hpp:71

{
 	namespace aux { struct session_impl; struct session_settings; }
 
 	struct settings_pack;
@@ -1958,7 +1904,7 @@ namespace libtorrent
 		{
 			string_type_base = 0x0000,
 			int_type_base =    0x4000,
-
relevance 2../include/libtorrent/socks5_stream.hpp:129fix error messages to use custom error_code category

fix error messages to use custom error_code category

../include/libtorrent/socks5_stream.hpp:129

relevance 2../include/libtorrent/socks5_stream.hpp:130add async_connect() that takes a hostname and port as well

add async_connect() that takes a hostname and port as well

../include/libtorrent/socks5_stream.hpp:130

		if (m_dst_name.size() > 255)
+
relevance 2../include/libtorrent/socks5_stream.hpp:129fix error messages to use custom error_code category

fix error messages to use custom error_code category

../include/libtorrent/socks5_stream.hpp:129

relevance 2../include/libtorrent/socks5_stream.hpp:130add async_connect() that takes a hostname and port as well

add async_connect() that takes a hostname and port as well

../include/libtorrent/socks5_stream.hpp:130

		if (m_dst_name.size() > 255)
 			m_dst_name.resize(255);
 	}
 
@@ -2009,7 +1955,7 @@ namespace libtorrent
 		m_resolver.async_resolve(q, boost::bind(
 			&socks5_stream::name_lookup, this, _1, _2, h));
 	}
-
relevance 2../include/libtorrent/torrent_info.hpp:306there may be some opportunities to optimize the size if torrent_info. specifically to turn some std::string and std::vector into pointers

there may be some opportunities to optimize the size if torrent_info. +

relevance 2../include/libtorrent/torrent_info.hpp:306there may be some opportunities to optimize the size if torrent_info. specifically to turn some std::string and std::vector into pointers

there may be some opportunities to optimize the size if torrent_info. specifically to turn some std::string and std::vector into pointers

../include/libtorrent/torrent_info.hpp:306

		bool resolving;
 
 		// if the user wanted to remove this while
@@ -2061,7 +2007,7 @@ specifically to turn some std::string and std::vector into pointers

../i #ifndef BOOST_NO_EXCEPTIONS torrent_info(lazy_entry const& torrent_file, int flags = 0); torrent_info(char const* buffer, int size, int flags = 0); -

relevance 2../include/libtorrent/aux_/session_interface.hpp:107the IP voting mechanism should be factored out to its own class, not part of the session

the IP voting mechanism should be factored out +

relevance 2../include/libtorrent/aux_/session_interface.hpp:107the IP voting mechanism should be factored out to its own class, not part of the session

the IP voting mechanism should be factored out to its own class, not part of the session

../include/libtorrent/aux_/session_interface.hpp:107

	class port_filter;
 	struct settings_pack;
 	struct torrent_peer_allocator_interface;
@@ -2113,7 +2059,7 @@ namespace libtorrent { namespace aux
 		virtual void queue_async_resume_data(boost::shared_ptr<torrent> const& t) = 0;
 		virtual void done_async_resume() = 0;
 		virtual void evict_torrent(torrent* t) = 0;
-
relevance 1../src/http_seed_connection.cpp:124in chunked encoding mode, this assert won't hold. the chunk headers should be subtracted from the receive_buffer_size

in chunked encoding mode, this assert won't hold. +

relevance 1../src/http_seed_connection.cpp:124in chunked encoding mode, this assert won't hold. the chunk headers should be subtracted from the receive_buffer_size

in chunked encoding mode, this assert won't hold. the chunk headers should be subtracted from the receive_buffer_size

../src/http_seed_connection.cpp:124

	boost::optional<piece_block_progress>
 	http_seed_connection::downloading_piece_progress() const
 	{
@@ -2165,8 +2111,8 @@ the chunk headers should be subtracted from the receive_buffer_size

../s std::string request; request.reserve(400); -

relevance 1../src/session_impl.cpp:6263report the proper address of the router as the source IP of this understanding of our external address, instead of the empty address

report the proper address of the router as the source IP of -this understanding of our external address, instead of the empty address

../src/session_impl.cpp:6263

	void session_impl::on_port_mapping(int mapping, address const& ip, int port
+
relevance 1../src/session_impl.cpp:6273report the proper address of the router as the source IP of this understanding of our external address, instead of the empty address

report the proper address of the router as the source IP of +this understanding of our external address, instead of the empty address

../src/session_impl.cpp:6273

	void session_impl::on_port_mapping(int mapping, address const& ip, int port
 		, error_code const& ec, int map_transport)
 	{
 		TORRENT_ASSERT(is_single_thread());
@@ -2217,9 +2163,9 @@ this understanding of our external address, instead of the empty address

relevance 1../src/session_impl.cpp:7402we only need to do this if our global IPv4 address has changed since the DHT (currently) only supports IPv4. Since restarting the DHT is kind of expensive, it would be nice to not do it unnecessarily

we only need to do this if our global IPv4 address has changed +

relevance 1../src/session_impl.cpp:7412we only need to do this if our global IPv4 address has changed since the DHT (currently) only supports IPv4. Since restarting the DHT is kind of expensive, it would be nice to not do it unnecessarily

we only need to do this if our global IPv4 address has changed since the DHT (currently) only supports IPv4. Since restarting the DHT -is kind of expensive, it would be nice to not do it unnecessarily

../src/session_impl.cpp:7402

#endif
+is kind of expensive, it would be nice to not do it unnecessarily

../src/session_impl.cpp:7412

#endif
 
 		if (!m_external_ip.cast_vote(ip, source_type, source)) return;
 
@@ -2270,7 +2216,7 @@ is kind of expensive, it would be nice to not do it unnecessarily

../src , boost::function<void(char*)> const& handler) { return m_disk_thread.async_allocate_disk_buffer(category, handler); -

relevance 1../src/torrent.cpp:1142make this depend on the error and on the filesystem the files are being downloaded to. If the error is no_space_left_on_device and the filesystem doesn't support sparse files, only zero the priorities of the pieces that are at the tails of all files, leaving everything up to the highest written piece in each file

make this depend on the error and on the filesystem the +

relevance 1../src/torrent.cpp:1142make this depend on the error and on the filesystem the files are being downloaded to. If the error is no_space_left_on_device and the filesystem doesn't support sparse files, only zero the priorities of the pieces that are at the tails of all files, leaving everything up to the highest written piece in each file

make this depend on the error and on the filesystem the files are being downloaded to. If the error is no_space_left_on_device and the filesystem doesn't support sparse files, only zero the priorities of the pieces that are at the tails of all files, leaving everything @@ -2325,8 +2271,8 @@ up to the highest written piece in each file

../src/torrent.cpp:1142

relevance 1../src/torrent.cpp:6842save the send_stats state instead of throwing them away it may pose an issue when downgrading though

save the send_stats state instead of throwing them away -it may pose an issue when downgrading though

../src/torrent.cpp:6842

					for (int k = 0; k < bits; ++k)
+
relevance 1../src/torrent.cpp:6843save the send_stats state instead of throwing them away it may pose an issue when downgrading though

save the send_stats state instead of throwing them away +it may pose an issue when downgrading though

../src/torrent.cpp:6843

					for (int k = 0; k < bits; ++k)
 						v |= (i->info[j*8+k].state == piece_picker::block_info::state_finished)
 						? (1 << k) : 0;
 					bitmask.append(1, v);
@@ -2377,9 +2323,9 @@ it may pose an issue when downgrading though

../src/torrent.cpp:6842

relevance 1../src/torrent.cpp:7913should disconnect all peers that have the pieces we have not just seeds. It would be pretty expensive to check all pieces for all peers though

should disconnect all peers that have the pieces we have +

relevance 1../src/torrent.cpp:7914should disconnect all peers that have the pieces we have not just seeds. It would be pretty expensive to check all pieces for all peers though

should disconnect all peers that have the pieces we have not just seeds. It would be pretty expensive to check all pieces -for all peers though

../src/torrent.cpp:7913

		set_state(torrent_status::finished);
+for all peers though

../src/torrent.cpp:7914

		set_state(torrent_status::finished);
 		set_queue_position(-1);
 
 		m_became_finished = m_ses.session_time();
@@ -2430,7 +2376,7 @@ for all peers though

../src/torrent.cpp:7913

relevance 1../src/kademlia/node.cpp:813find_node should write directly to the response entry

find_node should write directly to the response entry

../src/kademlia/node.cpp:813

			TORRENT_LOG(node) << " values: " << reply["values"].list().size();
+
relevance 1../src/kademlia/node.cpp:813find_node should write directly to the response entry

find_node should write directly to the response entry

../src/kademlia/node.cpp:813

			TORRENT_LOG(node) << " values: " << reply["values"].list().size();
 		}
 #endif
 	}
@@ -2481,7 +2427,7 @@ for all peers though

../src/torrent.cpp:7913

relevance 1../include/libtorrent/ip_voter.hpp:122instead, have one instance per possible subnet, global IPv4, global IPv6, loopback, 192.168.x.x, 10.x.x.x, etc.

instead, have one instance per possible subnet, global IPv4, global IPv6, loopback, 192.168.x.x, 10.x.x.x, etc.

../include/libtorrent/ip_voter.hpp:122

		// away all the votes and started from scratch, in case
+
relevance 1../include/libtorrent/ip_voter.hpp:122instead, have one instance per possible subnet, global IPv4, global IPv6, loopback, 192.168.x.x, 10.x.x.x, etc.

instead, have one instance per possible subnet, global IPv4, global IPv6, loopback, 192.168.x.x, 10.x.x.x, etc.

../include/libtorrent/ip_voter.hpp:122

		// away all the votes and started from scratch, in case
 		// our IP has changed
 		ptime m_last_rotate;
 	};
@@ -2508,7 +2454,7 @@ for all peers though

../src/torrent.cpp:7913

relevance 1../include/libtorrent/web_peer_connection.hpp:121if we make this be a disk_buffer_holder instead we would save a copy sometimes use allocate_disk_receive_buffer and release_disk_receive_buffer

if we make this be a disk_buffer_holder instead +

relevance 1../include/libtorrent/web_peer_connection.hpp:121if we make this be a disk_buffer_holder instead we would save a copy sometimes use allocate_disk_receive_buffer and release_disk_receive_buffer

if we make this be a disk_buffer_holder instead we would save a copy sometimes use allocate_disk_receive_buffer and release_disk_receive_buffer

../include/libtorrent/web_peer_connection.hpp:121

 		// returns the block currently being
@@ -2561,7 +2507,7 @@ use allocate_disk_receive_buffer and release_disk_receive_buffer

../incl }; } -

relevance 0../test/test_block_cache.cpp:472test try_evict_blocks

test try_evict_blocks

../test/test_block_cache.cpp:472

relevance 0../test/test_block_cache.cpp:473test evicting volatile pieces, to see them be removed

test evicting volatile pieces, to see them be removed

../test/test_block_cache.cpp:473

relevance 0../test/test_block_cache.cpp:474test evicting dirty pieces

test evicting dirty pieces

../test/test_block_cache.cpp:474

relevance 0../test/test_block_cache.cpp:475test free_piece

test free_piece

../test/test_block_cache.cpp:475

relevance 0../test/test_block_cache.cpp:476test abort_dirty

test abort_dirty

../test/test_block_cache.cpp:476

relevance 0../test/test_block_cache.cpp:477test unaligned reads

test unaligned reads

../test/test_block_cache.cpp:477

	// it's supposed to be a cache hit
+
relevance 0../test/test_block_cache.cpp:472test try_evict_blocks

test try_evict_blocks

../test/test_block_cache.cpp:472

relevance 0../test/test_block_cache.cpp:473test evicting volatile pieces, to see them be removed

test evicting volatile pieces, to see them be removed

../test/test_block_cache.cpp:473

relevance 0../test/test_block_cache.cpp:474test evicting dirty pieces

test evicting dirty pieces

../test/test_block_cache.cpp:474

relevance 0../test/test_block_cache.cpp:475test free_piece

test free_piece

../test/test_block_cache.cpp:475

relevance 0../test/test_block_cache.cpp:476test abort_dirty

test abort_dirty

../test/test_block_cache.cpp:476

relevance 0../test/test_block_cache.cpp:477test unaligned reads

test unaligned reads

../test/test_block_cache.cpp:477

	// it's supposed to be a cache hit
 	TEST_CHECK(ret >= 0);
 	// return the reference to the buffer we just read
 	RETURN_BUFFER;
@@ -2584,7 +2530,7 @@ int test_main()
 
return 0;
} -
relevance 0../test/test_metadata_extension.cpp:73it would be nice to test reversing which session is making the connection as well

it would be nice to test reversing +

relevance 0../test/test_metadata_extension.cpp:73it would be nice to test reversing which session is making the connection as well

it would be nice to test reversing which session is making the connection as well

../test/test_metadata_extension.cpp:73

 void test_transfer(int flags
 	, boost::shared_ptr<libtorrent::torrent_plugin> (*constructor)(libtorrent::torrent*, void*)
@@ -2636,7 +2582,7 @@ void test_transfer(int flags
 		if ((flags & disconnect) == 0) tor2.status();
 		print_alerts(*seed, "seed", false, true);
 		print_alerts(*downloader, "downloader", false, true);
-
relevance 0../test/test_policy.cpp:419test applying a port_filter

test applying a port_filter

../test/test_policy.cpp:419

relevance 0../test/test_policy.cpp:420test erasing peers

test erasing peers

../test/test_policy.cpp:420

relevance 0../test/test_policy.cpp:421test using port and ip filter

test using port and ip filter

../test/test_policy.cpp:421

relevance 0../test/test_policy.cpp:422test incrementing failcount (and make sure we no longer consider the peer a connect canidate)

test incrementing failcount (and make sure we no longer consider the peer a connect canidate)

../test/test_policy.cpp:422

relevance 0../test/test_policy.cpp:423test max peerlist size

test max peerlist size

../test/test_policy.cpp:423

relevance 0../test/test_policy.cpp:424test logic for which connection to keep when receiving an incoming connection to the same peer as we just made an outgoing connection to

test logic for which connection to keep when receiving an incoming connection to the same peer as we just made an outgoing connection to

../test/test_policy.cpp:424

relevance 0../test/test_policy.cpp:425test update_peer_port with allow_multiple_connections_per_ip

test update_peer_port with allow_multiple_connections_per_ip

../test/test_policy.cpp:425

relevance 0../test/test_policy.cpp:426test set_seed

test set_seed

../test/test_policy.cpp:426

relevance 0../test/test_policy.cpp:427test has_peer

test has_peer

../test/test_policy.cpp:427

relevance 0../test/test_policy.cpp:428test insert_peer with a full list

test insert_peer with a full list

../test/test_policy.cpp:428

relevance 0../test/test_policy.cpp:429test add i2p peers

test add i2p peers

../test/test_policy.cpp:429

relevance 0../test/test_policy.cpp:430test allow_i2p_mixed

test allow_i2p_mixed

../test/test_policy.cpp:430

relevance 0../test/test_policy.cpp:431test insert_peer failing

test insert_peer failing

../test/test_policy.cpp:431

relevance 0../test/test_policy.cpp:432test IPv6

test IPv6

../test/test_policy.cpp:432

relevance 0../test/test_policy.cpp:433test connect_to_peer() failing

test connect_to_peer() failing

../test/test_policy.cpp:433

relevance 0../test/test_policy.cpp:434test connection_closed

test connection_closed

../test/test_policy.cpp:434

relevance 0../test/test_policy.cpp:435test recalculate connect candidates

test recalculate connect candidates

../test/test_policy.cpp:435

relevance 0../test/test_policy.cpp:436add tests here

add tests here

../test/test_policy.cpp:436

		for (int i = 0; i < 100; ++i)
+
relevance 0../test/test_policy.cpp:419test applying a port_filter

test applying a port_filter

../test/test_policy.cpp:419

relevance 0../test/test_policy.cpp:420test erasing peers

test erasing peers

../test/test_policy.cpp:420

relevance 0../test/test_policy.cpp:421test using port and ip filter

test using port and ip filter

../test/test_policy.cpp:421

relevance 0../test/test_policy.cpp:422test incrementing failcount (and make sure we no longer consider the peer a connect canidate)

test incrementing failcount (and make sure we no longer consider the peer a connect canidate)

../test/test_policy.cpp:422

relevance 0../test/test_policy.cpp:423test max peerlist size

test max peerlist size

../test/test_policy.cpp:423

relevance 0../test/test_policy.cpp:424test logic for which connection to keep when receiving an incoming connection to the same peer as we just made an outgoing connection to

test logic for which connection to keep when receiving an incoming connection to the same peer as we just made an outgoing connection to

../test/test_policy.cpp:424

relevance 0../test/test_policy.cpp:425test update_peer_port with allow_multiple_connections_per_ip

test update_peer_port with allow_multiple_connections_per_ip

../test/test_policy.cpp:425

relevance 0../test/test_policy.cpp:426test set_seed

test set_seed

../test/test_policy.cpp:426

relevance 0../test/test_policy.cpp:427test has_peer

test has_peer

../test/test_policy.cpp:427

relevance 0../test/test_policy.cpp:428test insert_peer with a full list

test insert_peer with a full list

../test/test_policy.cpp:428

relevance 0../test/test_policy.cpp:429test add i2p peers

test add i2p peers

../test/test_policy.cpp:429

relevance 0../test/test_policy.cpp:430test allow_i2p_mixed

test allow_i2p_mixed

../test/test_policy.cpp:430

relevance 0../test/test_policy.cpp:431test insert_peer failing

test insert_peer failing

../test/test_policy.cpp:431

relevance 0../test/test_policy.cpp:432test IPv6

test IPv6

../test/test_policy.cpp:432

relevance 0../test/test_policy.cpp:433test connect_to_peer() failing

test connect_to_peer() failing

../test/test_policy.cpp:433

relevance 0../test/test_policy.cpp:434test connection_closed

test connection_closed

../test/test_policy.cpp:434

relevance 0../test/test_policy.cpp:435test recalculate connect candidates

test recalculate connect candidates

../test/test_policy.cpp:435

relevance 0../test/test_policy.cpp:436add tests here

add tests here

../test/test_policy.cpp:436

		for (int i = 0; i < 100; ++i)
 		{
 			torrent_peer* peer = p.add_peer(rand_tcp_ep(), 0, 0, &st);
 			TEST_EQUAL(st.erased.size(), 0);
@@ -2660,7 +2606,7 @@ void test_transfer(int flags
 	return 0;
 }
 
-
relevance 0../test/test_primitives.cpp:213test the case where we have > 120 samples (and have the base delay actually be updated)

test the case where we have > 120 samples (and have the base delay actually be updated)

../test/test_primitives.cpp:213

relevance 0../test/test_primitives.cpp:214test the case where a sample is lower than the history entry but not lower than the base

test the case where a sample is lower than the history entry but not lower than the base

../test/test_primitives.cpp:214

	TEST_CHECK(!filter.find(k3));
+
relevance 0../test/test_primitives.cpp:213test the case where we have > 120 samples (and have the base delay actually be updated)

test the case where we have > 120 samples (and have the base delay actually be updated)

../test/test_primitives.cpp:213

relevance 0../test/test_primitives.cpp:214test the case where a sample is lower than the history entry but not lower than the base

test the case where a sample is lower than the history entry but not lower than the base

../test/test_primitives.cpp:214

	TEST_CHECK(!filter.find(k3));
 	TEST_CHECK(filter.find(k4));
 
 	// test timestamp_history
@@ -2711,7 +2657,7 @@ void test_transfer(int flags
 	sanitize_append_path_element(path, "a...b", 5);
 	TEST_EQUAL(path, "a...b");
 
-
relevance 0../test/test_rss.cpp:136verify some key state is saved in 'state'

verify some key state is saved in 'state'

../test/test_rss.cpp:136

	feed_status st;
+
relevance 0../test/test_rss.cpp:136verify some key state is saved in 'state'

verify some key state is saved in 'state'

../test/test_rss.cpp:136

	feed_status st;
 	f->get_feed_status(&st);
 	TEST_CHECK(!st.error);
 
@@ -2746,7 +2692,7 @@ int test_main()
 	return 0;
 }
 
-
relevance 0../test/test_ssl.cpp:344test using a signed certificate with the wrong info-hash in DN

test using a signed certificate with the wrong info-hash in DN

../test/test_ssl.cpp:344

	// in verifying peers
+
relevance 0../test/test_ssl.cpp:344test using a signed certificate with the wrong info-hash in DN

test using a signed certificate with the wrong info-hash in DN

../test/test_ssl.cpp:344

	// in verifying peers
 	ctx.set_verify_mode(context::verify_none, ec);
 	if (ec)
 	{
@@ -2797,7 +2743,7 @@ int test_main()
 			return false;
 		}
 		fprintf(stderr, "use_tmp_dh_file \"%s\"\n", dh_params.c_str());
-
relevance 0../test/test_ssl.cpp:442also test using a hash that refers to a valid torrent but that differs from the SNI hash

also test using a hash that refers to a valid torrent +

relevance 0../test/test_ssl.cpp:442also test using a hash that refers to a valid torrent but that differs from the SNI hash

also test using a hash that refers to a valid torrent but that differs from the SNI hash

../test/test_ssl.cpp:442

	print_alerts(ses1, "ses1", true, true, true, &on_alert);
 	if (ec)
 	{
@@ -2849,7 +2795,7 @@ but that differs from the SNI hash

../test/test_ssl.cpp:442

relevance 0../test/test_torrent.cpp:132wait for an alert rather than just waiting 10 seconds. This is kind of silly

wait for an alert rather than just waiting 10 seconds. This is kind of silly

../test/test_torrent.cpp:132

			TEST_EQUAL(h.file_priorities().size(), info->num_files());
+
relevance 0../test/test_torrent.cpp:132wait for an alert rather than just waiting 10 seconds. This is kind of silly

wait for an alert rather than just waiting 10 seconds. This is kind of silly

../test/test_torrent.cpp:132

			TEST_EQUAL(h.file_priorities().size(), info->num_files());
 			TEST_EQUAL(h.file_priorities()[0], 0);
 			if (info->num_files() > 1)
 				TEST_EQUAL(h.file_priorities()[1], 0);
@@ -2900,7 +2846,7 @@ but that differs from the SNI hash

../test/test_ssl.cpp:442

relevance 0../test/test_torrent_parse.cpp:114test remap_files

test remap_files

../test/test_torrent_parse.cpp:114

relevance 0../test/test_torrent_parse.cpp:115merkle torrents. specifically torrent_info::add_merkle_nodes and torrent with "root hash"

merkle torrents. specifically torrent_info::add_merkle_nodes and torrent with "root hash"

../test/test_torrent_parse.cpp:115

relevance 0../test/test_torrent_parse.cpp:116torrent with 'p' (padfile) attribute

torrent with 'p' (padfile) attribute

../test/test_torrent_parse.cpp:116

relevance 0../test/test_torrent_parse.cpp:117torrent with 'h' (hidden) attribute

torrent with 'h' (hidden) attribute

../test/test_torrent_parse.cpp:117

relevance 0../test/test_torrent_parse.cpp:118torrent with 'x' (executable) attribute

torrent with 'x' (executable) attribute

../test/test_torrent_parse.cpp:118

relevance 0../test/test_torrent_parse.cpp:119torrent with 'l' (symlink) attribute

torrent with 'l' (symlink) attribute

../test/test_torrent_parse.cpp:119

relevance 0../test/test_torrent_parse.cpp:120creating a merkle torrent (torrent_info::build_merkle_list)

creating a merkle torrent (torrent_info::build_merkle_list)

../test/test_torrent_parse.cpp:120

relevance 0../test/test_torrent_parse.cpp:121torrent with multiple trackers in multiple tiers, making sure we shuffle them (how do you test shuffling?, load it multiple times and make sure it's in different order at least once)

torrent with multiple trackers in multiple tiers, making sure we shuffle them (how do you test shuffling?, load it multiple times and make sure it's in different order at least once)

../test/test_torrent_parse.cpp:121

	{ "invalid_info.torrent", errors::torrent_missing_info },
+
relevance 0../test/test_torrent_parse.cpp:114test remap_files

test remap_files

../test/test_torrent_parse.cpp:114

relevance 0../test/test_torrent_parse.cpp:115merkle torrents. specifically torrent_info::add_merkle_nodes and torrent with "root hash"

merkle torrents. specifically torrent_info::add_merkle_nodes and torrent with "root hash"

../test/test_torrent_parse.cpp:115

relevance 0../test/test_torrent_parse.cpp:116torrent with 'p' (padfile) attribute

torrent with 'p' (padfile) attribute

../test/test_torrent_parse.cpp:116

relevance 0../test/test_torrent_parse.cpp:117torrent with 'h' (hidden) attribute

torrent with 'h' (hidden) attribute

../test/test_torrent_parse.cpp:117

relevance 0../test/test_torrent_parse.cpp:118torrent with 'x' (executable) attribute

torrent with 'x' (executable) attribute

../test/test_torrent_parse.cpp:118

relevance 0../test/test_torrent_parse.cpp:119torrent with 'l' (symlink) attribute

torrent with 'l' (symlink) attribute

../test/test_torrent_parse.cpp:119

relevance 0../test/test_torrent_parse.cpp:120creating a merkle torrent (torrent_info::build_merkle_list)

creating a merkle torrent (torrent_info::build_merkle_list)

../test/test_torrent_parse.cpp:120

relevance 0../test/test_torrent_parse.cpp:121torrent with multiple trackers in multiple tiers, making sure we shuffle them (how do you test shuffling?, load it multiple times and make sure it's in different order at least once)

torrent with multiple trackers in multiple tiers, making sure we shuffle them (how do you test shuffling?, load it multiple times and make sure it's in different order at least once)

../test/test_torrent_parse.cpp:121

	{ "invalid_info.torrent", errors::torrent_missing_info },
 	{ "string.torrent", errors::torrent_is_no_dict },
 	{ "negative_size.torrent", errors::torrent_invalid_length },
 	{ "negative_file_size.torrent", errors::torrent_file_parse_failed },
@@ -2951,7 +2897,7 @@ namespace libtorrent
 	TEST_EQUAL(merkle_num_leafs(15), 16);
 	TEST_EQUAL(merkle_num_leafs(16), 16);
 	TEST_EQUAL(merkle_num_leafs(17), 32);
-
relevance 0../test/test_tracker.cpp:198test parse peers6

test parse peers6

../test/test_tracker.cpp:198

relevance 0../test/test_tracker.cpp:199test parse tracker-id

test parse tracker-id

../test/test_tracker.cpp:199

relevance 0../test/test_tracker.cpp:200test parse failure-reason

test parse failure-reason

../test/test_tracker.cpp:200

relevance 0../test/test_tracker.cpp:201test all failure paths invalid bencoding not a dictionary no files entry in scrape response no info-hash entry in scrape response malformed peers in peer list of dictionaries uneven number of bytes in peers and peers6 string responses

test all failure paths +

relevance 0../test/test_tracker.cpp:198test parse peers6

test parse peers6

../test/test_tracker.cpp:198

relevance 0../test/test_tracker.cpp:199test parse tracker-id

test parse tracker-id

../test/test_tracker.cpp:199

relevance 0../test/test_tracker.cpp:200test parse failure-reason

test parse failure-reason

../test/test_tracker.cpp:200

relevance 0../test/test_tracker.cpp:201test all failure paths invalid bencoding not a dictionary no files entry in scrape response no info-hash entry in scrape response malformed peers in peer list of dictionaries uneven number of bytes in peers and peers6 string responses

test all failure paths invalid bencoding not a dictionary no files entry in scrape response @@ -3008,7 +2954,7 @@ int test_main() snprintf(tracker_url, sizeof(tracker_url), "http://127.0.0.1:%d/announce", http_port); t->add_tracker(tracker_url, 0); -

relevance 0../test/test_upnp.cpp:100store the log and verify that some key messages are there

store the log and verify that some key messages are there

../test/test_upnp.cpp:100

		"USN:uuid:000f-66d6-7296000099dc::upnp:rootdevice\r\n"
+
relevance 0../test/test_upnp.cpp:100store the log and verify that some key messages are there

store the log and verify that some key messages are there

../test/test_upnp.cpp:100

		"USN:uuid:000f-66d6-7296000099dc::upnp:rootdevice\r\n"
 		"Location: http://127.0.0.1:%d/upnp.xml\r\n"
 		"Server: Custom/1.0 UPnP/1.0 Proc/Ver\r\n"
 		"EXT:\r\n"
@@ -3059,7 +3005,7 @@ int run_upnp_test(char const* root_filename, char const* router_model, char cons
 	error_code ec;
 	load_file(root_filename, buf, ec);
 	buf.push_back(0);
-
relevance 0../test/web_seed_suite.cpp:373file hashes don't work with the new torrent creator reading async

file hashes don't work with the new torrent creator reading async

../test/web_seed_suite.cpp:373

		// corrupt the files now, so that the web seed will be banned
+
relevance 0../test/web_seed_suite.cpp:373file hashes don't work with the new torrent creator reading async

file hashes don't work with the new torrent creator reading async

../test/web_seed_suite.cpp:373

		// corrupt the files now, so that the web seed will be banned
 		if (test_url_seed)
 		{
 			create_random_files(combine_path(save_path, "torrent_dir"), file_sizes, sizeof(file_sizes)/sizeof(file_sizes[0]));
@@ -3110,7 +3056,7 @@ int run_upnp_test(char const* root_filename, char const* router_model, char cons
 			, chunked_encoding, test_ban, keepalive);
 		
 		if (test_url_seed && test_rename)
-
relevance 0../src/block_cache.cpp:884it's somewhat expensive to iterate over this linked list. Presumably because of the random access of memory. It would be nice if pieces with no evictable blocks weren't in this list

it's somewhat expensive +

relevance 0../src/block_cache.cpp:884it's somewhat expensive to iterate over this linked list. Presumably because of the random access of memory. It would be nice if pieces with no evictable blocks weren't in this list

it's somewhat expensive to iterate over this linked list. Presumably because of the random access of memory. It would be nice if pieces with no evictable blocks weren't in this list

../src/block_cache.cpp:884

	}
@@ -3164,7 +3110,7 @@ weren't in this list

../src/block_cache.cpp:884

relevance 0../src/block_cache.cpp:948this should probably only be done every n:th time

this should probably only be done every n:th time

../src/block_cache.cpp:948

			}
+
relevance 0../src/block_cache.cpp:948this should probably only be done every n:th time

this should probably only be done every n:th time

../src/block_cache.cpp:948

			}
 
 			if (pe->ok_to_evict())
 			{
@@ -3215,7 +3161,7 @@ weren't in this list

../src/block_cache.cpp:884

relevance 0../src/block_cache.cpp:1720create a holder for refcounts that automatically decrement

create a holder for refcounts that automatically decrement

../src/block_cache.cpp:1720

	}
+
relevance 0../src/block_cache.cpp:1720create a holder for refcounts that automatically decrement

create a holder for refcounts that automatically decrement

../src/block_cache.cpp:1720

	}
 
 	j->buffer = allocate_buffer("send buffer");
 	if (j->buffer == 0) return -2;
@@ -3266,7 +3212,7 @@ bool block_cache::maybe_free_piece(cached_piece_entry* pe)
 
 	boost::shared_ptr<piece_manager> s = pe->storage;
 
-
relevance 0../src/bt_peer_connection.cpp:645this could be optimized using knuth morris pratt

this could be optimized using knuth morris pratt

../src/bt_peer_connection.cpp:645

		{
+
relevance 0../src/bt_peer_connection.cpp:645this could be optimized using knuth morris pratt

this could be optimized using knuth morris pratt

../src/bt_peer_connection.cpp:645

		{
 			disconnect(errors::no_memory, op_encryption);
 			return;
 		}
@@ -3317,7 +3263,7 @@ bool block_cache::maybe_free_piece(cached_piece_entry* pe)
 // 		}
 
         // no complete sync
-
relevance 0../src/bt_peer_connection.cpp:2209if we're finished, send upload_only message

if we're finished, send upload_only message

../src/bt_peer_connection.cpp:2209

			if (msg[5 + k / 8] & (0x80 >> (k % 8))) bitfield_string[k] = '1';
+
relevance 0../src/bt_peer_connection.cpp:2209if we're finished, send upload_only message

if we're finished, send upload_only message

../src/bt_peer_connection.cpp:2209

			if (msg[5 + k / 8] & (0x80 >> (k % 8))) bitfield_string[k] = '1';
 			else bitfield_string[k] = '0';
 		}
 		peer_log("==> BITFIELD [ %s ]", bitfield_string.c_str());
@@ -3368,7 +3314,7 @@ bool block_cache::maybe_free_piece(cached_piece_entry* pe)
 				? m_settings.get_str(settings_pack::user_agent)
 				: m_settings.get_str(settings_pack::handshake_client_version);
 		}
-
relevance 0../src/disk_io_thread.cpp:921instead of doing a lookup each time through the loop, save cached_piece_entry pointers with piece_refcount incremented to pin them

instead of doing a lookup each time through the loop, save +

relevance 0../src/disk_io_thread.cpp:921instead of doing a lookup each time through the loop, save cached_piece_entry pointers with piece_refcount incremented to pin them

instead of doing a lookup each time through the loop, save cached_piece_entry pointers with piece_refcount incremented to pin them

../src/disk_io_thread.cpp:921

	// this is why we pass in 1 as cont_block to the flushing functions
 	void disk_io_thread::try_flush_write_blocks(int num, tailqueue& completed_jobs
 		, mutex::scoped_lock& l)
@@ -3420,7 +3366,7 @@ cached_piece_entry pointers with piece_refcount incremented to pin them

cached_piece_entry* pe = m_disk_cache.find_piece(i->first, i->second); if (pe == NULL) continue; if (pe->num_dirty == 0) continue; -

relevance 0../src/disk_io_thread.cpp:1132instead of doing this. pass in the settings to each storage_interface call. Each disk thread could hold its most recent understanding of the settings in a shared_ptr, and update it every time it wakes up from a job. That way each access to the settings won't require a mutex to be held.

instead of doing this. pass in the settings to each storage_interface +

relevance 0../src/disk_io_thread.cpp:1132instead of doing this. pass in the settings to each storage_interface call. Each disk thread could hold its most recent understanding of the settings in a shared_ptr, and update it every time it wakes up from a job. That way each access to the settings won't require a mutex to be held.

instead of doing this. pass in the settings to each storage_interface call. Each disk thread could hold its most recent understanding of the settings in a shared_ptr, and update it every time it wakes up from a job. That way each access to the settings won't require a mutex to be held.

../src/disk_io_thread.cpp:1132

	{
@@ -3464,7 +3410,7 @@ each access to the settings won't require a mutex to be held.

../src/dis // our quanta in case there aren't any other // jobs to run in between -

relevance 0../src/disk_io_thread.cpp:1157a potentially more efficient solution would be to have a special queue for retry jobs, that's only ever run when a job completes, in any thread. It would only work if m_outstanding_jobs > 0

a potentially more efficient solution would be to have a special +

relevance 0../src/disk_io_thread.cpp:1157a potentially more efficient solution would be to have a special queue for retry jobs, that's only ever run when a job completes, in any thread. It would only work if m_outstanding_jobs > 0

a potentially more efficient solution would be to have a special queue for retry jobs, that's only ever run when a job completes, in any thread. It would only work if m_outstanding_jobs > 0

../src/disk_io_thread.cpp:1157

			storage->get_storage_impl()->m_settings = &m_settings;
 
@@ -3497,7 +3443,7 @@ any thread. It would only work if m_outstanding_jobs > 0

../src/disk_io_ } #if TORRENT_USE_ASSERT -

relevance 0../src/disk_io_thread.cpp:1171it should clear the hash state even when there's an error, right?

it should clear the hash state even when there's an error, right?

../src/disk_io_thread.cpp:1171

		--m_outstanding_jobs;
+
relevance 0../src/disk_io_thread.cpp:1171it should clear the hash state even when there's an error, right?

it should clear the hash state even when there's an error, right?

../src/disk_io_thread.cpp:1171

		--m_outstanding_jobs;
 
 		if (ret == retry_job)
 		{
@@ -3548,7 +3494,7 @@ any thread. It would only work if m_outstanding_jobs > 0

../src/disk_io_ j->error.operation = storage_error::alloc_cache_piece; return -1; } -

relevance 0../src/disk_io_thread.cpp:1866maybe the tailqueue_iterator should contain a pointer-pointer instead and have an unlink function

maybe the tailqueue_iterator should contain a pointer-pointer +

relevance 0../src/disk_io_thread.cpp:1866maybe the tailqueue_iterator should contain a pointer-pointer instead and have an unlink function

maybe the tailqueue_iterator should contain a pointer-pointer instead and have an unlink function

../src/disk_io_thread.cpp:1866

		j->callback = handler;
 
 		add_fence_job(storage, j);
@@ -3600,7 +3546,7 @@ instead and have an unlink function

../src/disk_io_thread.cpp:1866

< if (completed_jobs.size()) add_completed_jobs(completed_jobs); } -
relevance 0../src/disk_io_thread.cpp:2121this is potentially very expensive. One way to solve it would be to have a fence for just this one piece.

this is potentially very expensive. One way to solve +

relevance 0../src/disk_io_thread.cpp:2121this is potentially very expensive. One way to solve it would be to have a fence for just this one piece.

this is potentially very expensive. One way to solve it would be to have a fence for just this one piece.

../src/disk_io_thread.cpp:2121

	}
 
 	void disk_io_thread::async_clear_piece(piece_manager* storage, int index
@@ -3652,7 +3598,7 @@ it would be to have a fence for just this one piece.

../src/disk_io_thre if (!pe->hash) return; if (pe->hashing) return; -

relevance 0../src/disk_io_thread.cpp:2382we should probably just hang the job on the piece and make sure the hasher gets kicked

we should probably just hang the job on the piece and make sure the hasher gets kicked

../src/disk_io_thread.cpp:2382

		if (pe == NULL)
+
relevance 0../src/disk_io_thread.cpp:2382we should probably just hang the job on the piece and make sure the hasher gets kicked

we should probably just hang the job on the piece and make sure the hasher gets kicked

../src/disk_io_thread.cpp:2382

		if (pe == NULL)
 		{
 			int cache_state = (j->flags & disk_io_job::volatile_read)
 				? cached_piece_entry::volatile_read_lru
@@ -3703,7 +3649,7 @@ it would be to have a fence for just this one piece.

../src/disk_io_thre // increment the refcounts of all // blocks up front, and then hash them without holding the lock -

relevance 0../src/disk_io_thread.cpp:2452introduce a holder class that automatically increments and decrements the piece_refcount

introduce a holder class that automatically increments +

relevance 0../src/disk_io_thread.cpp:2452introduce a holder class that automatically increments and decrements the piece_refcount

introduce a holder class that automatically increments and decrements the piece_refcount

../src/disk_io_thread.cpp:2452

		for (int i = ph->offset / block_size; i < blocks_in_piece; ++i)
 		{
 			iov.iov_len = (std::min)(block_size, piece_size - ph->offset);
@@ -3755,7 +3701,7 @@ and decrements the piece_refcount

../src/disk_io_thread.cpp:2452

relevance 0../src/disk_io_thread.cpp:2692it would be nice to not have to lock the mutex every turn through this loop

it would be nice to not have to lock the mutex every +

relevance 0../src/disk_io_thread.cpp:2692it would be nice to not have to lock the mutex every turn through this loop

it would be nice to not have to lock the mutex every turn through this loop

../src/disk_io_thread.cpp:2692

		{
 			j->error.ec = error::no_memory;
 			j->error.operation = storage_error::alloc_cache_piece;
@@ -3807,7 +3753,7 @@ turn through this loop

../src/disk_io_thread.cpp:2692

relevance 0../src/http_tracker_connection.cpp:94support authentication (i.e. user name and password) in the URL

support authentication (i.e. user name and password) in the URL

../src/http_tracker_connection.cpp:94

		, tracker_manager& man
+
relevance 0../src/http_tracker_connection.cpp:94support authentication (i.e. user name and password) in the URL

support authentication (i.e. user name and password) in the URL

../src/http_tracker_connection.cpp:94

		, tracker_manager& man
 		, tracker_request const& req
 		, boost::weak_ptr<request_callback> c
 		, aux::session_impl& ses
@@ -3858,7 +3804,7 @@ turn through this loop

../src/disk_io_thread.cpp:2692

relevance 0../src/metadata_transfer.cpp:359this is not safe. The torrent could be unloaded while we're still sending the metadata

this is not safe. The torrent could be unloaded while +

relevance 0../src/metadata_transfer.cpp:359this is not safe. The torrent could be unloaded while we're still sending the metadata

this is not safe. The torrent could be unloaded while we're still sending the metadata

../src/metadata_transfer.cpp:359

				std::pair<int, int> offset
 					= req_to_offset(req, (int)m_tp.metadata().left());
 
@@ -3910,7 +3856,7 @@ we're still sending the metadata

../src/metadata_transfer.cpp:359

relevance 0../src/packet_buffer.cpp:176use compare_less_wrap for this comparison as well

use compare_less_wrap for this comparison as well

../src/packet_buffer.cpp:176

		while (new_size < size)
+
relevance 0../src/packet_buffer.cpp:176use compare_less_wrap for this comparison as well

use compare_less_wrap for this comparison as well

../src/packet_buffer.cpp:176

		while (new_size < size)
 			new_size <<= 1;
 
 		void** new_storage = (void**)malloc(sizeof(void*) * new_size);
@@ -3961,7 +3907,7 @@ we're still sending the metadata

../src/metadata_transfer.cpp:359

relevance 0../src/part_file.cpp:252what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data from disk, but it may be overwritten soon, it's probably not that big of a deal

what do we do if someone is currently reading from the disk +

relevance 0../src/part_file.cpp:252what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data from disk, but it may be overwritten soon, it's probably not that big of a deal

what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data from disk, but it may be overwritten soon, it's probably not that big of a deal

../src/part_file.cpp:252

		if (((mode & file::rw_mask) != file::read_only)
@@ -4015,7 +3961,7 @@ big of a deal

../src/part_file.cpp:252

relevance 0../src/part_file.cpp:344instead of rebuilding the whole file header and flushing it, update the slot entries as we go

instead of rebuilding the whole file header +

relevance 0../src/part_file.cpp:344instead of rebuilding the whole file header and flushing it, update the slot entries as we go

instead of rebuilding the whole file header and flushing it, update the slot entries as we go

../src/part_file.cpp:344

				if (block_to_copy == m_piece_size)
 				{
 					m_free_slots.push_back(i->second);
@@ -4067,7 +4013,7 @@ and flushing it, update the slot entries as we go

../src/part_file.cpp:3 for (int piece = 0; piece < m_max_pieces; ++piece) { -

relevance 0../src/peer_connection.cpp:1194this should be the global download rate

this should be the global download rate

../src/peer_connection.cpp:1194

+
relevance 0../src/peer_connection.cpp:1194this should be the global download rate

this should be the global download rate

../src/peer_connection.cpp:1194

 		int rate = 0;
 
 		// if we haven't received any data recently, the current download rate
@@ -4118,7 +4064,7 @@ and flushing it, update the slot entries as we go

../src/part_file.cpp:3 if (m_ignore_stats) return; boost::shared_ptr<torrent> t = m_torrent.lock(); if (!t) return; -

relevance 0../src/peer_connection.cpp:3427sort the allowed fast set in priority order

sort the allowed fast set in priority order

../src/peer_connection.cpp:3427

+
relevance 0../src/peer_connection.cpp:3427sort the allowed fast set in priority order

sort the allowed fast set in priority order

../src/peer_connection.cpp:3427

 		// if the peer has the piece and we want
 		// to download it, request it
 		if (int(m_have_piece.size()) > index
@@ -4169,7 +4115,7 @@ and flushing it, update the slot entries as we go

../src/part_file.cpp:3 boost::shared_ptr<torrent> t = m_torrent.lock(); TORRENT_ASSERT(t); TORRENT_ASSERT(t->has_picker()); -

relevance 0../src/piece_picker.cpp:2407when expanding pieces for cache stripe reasons, the !downloading condition doesn't make much sense

when expanding pieces for cache stripe reasons, +

relevance 0../src/piece_picker.cpp:2407when expanding pieces for cache stripe reasons, the !downloading condition doesn't make much sense

when expanding pieces for cache stripe reasons, the !downloading condition doesn't make much sense

../src/piece_picker.cpp:2407

		TORRENT_ASSERT(index < (int)m_piece_map.size() || m_piece_map.empty());
 		if (index+1 == (int)m_piece_map.size())
 			return m_blocks_in_last_piece;
@@ -4221,7 +4167,7 @@ the !downloading condition doesn't make much sense

../src/piece_picker.c // the second bool is true if this is the only active peer that is requesting // and downloading blocks from this piece. Active means having a connection. boost::tuple<bool, bool> requested_from(piece_picker::downloading_piece const& p -

relevance 0../src/session_impl.cpp:603there's no rule here to make uTP connections not have the global or local rate limits apply to it. This used to be the default.

there's no rule here to make uTP connections not have the global or +

relevance 0../src/session_impl.cpp:603there's no rule here to make uTP connections not have the global or local rate limits apply to it. This used to be the default.

there's no rule here to make uTP connections not have the global or local rate limits apply to it. This used to be the default.

../src/session_impl.cpp:603

		m_global_class = m_classes.new_peer_class("global");
 		m_tcp_peer_class = m_classes.new_peer_class("tcp");
 		m_local_peer_class = m_classes.new_peer_class("local");
@@ -4273,7 +4219,7 @@ local rate limits apply to it. This used to be the default.

../src/sessi get_thread_cpu_usage(&m_network_thread_cpu_usage); -

relevance 0../src/session_impl.cpp:2159instead of having a special case for this, just make the default listen interfaces be "0.0.0.0:6881,[::1]:6881" and use the generic path. That would even allow for not listening at all.

instead of having a special case for this, just make the +

relevance 0../src/session_impl.cpp:2159instead of having a special case for this, just make the default listen interfaces be "0.0.0.0:6881,[::1]:6881" and use the generic path. That would even allow for not listening at all.

instead of having a special case for this, just make the default listen interfaces be "0.0.0.0:6881,[::1]:6881" and use the generic path. That would even allow for not listening at all.

../src/session_impl.cpp:2159

 		// reset the retry counter
@@ -4326,7 +4272,7 @@ retry:
 
 				if (s.sock)
 				{
-
relevance 0../src/session_impl.cpp:3004should this function take a shared_ptr instead?

should this function take a shared_ptr instead?

../src/session_impl.cpp:3004

	{
+
relevance 0../src/session_impl.cpp:3004should this function take a shared_ptr instead?

should this function take a shared_ptr instead?

../src/session_impl.cpp:3004

	{
 #if defined TORRENT_ASIO_DEBUGGING
 		complete_async("session_impl::on_socks_accept");
 #endif
@@ -4377,7 +4323,7 @@ retry:
 		TORRENT_ASSERT(sp.use_count() > 0);
 
 		connection_map::iterator i = m_connections.find(sp);
-
relevance 0../src/session_impl.cpp:3358have a separate list for these connections, instead of having to loop through all of them

have a separate list for these connections, instead of having to loop through all of them

../src/session_impl.cpp:3358

		if (m_auto_manage_time_scaler < 0)
+
relevance 0../src/session_impl.cpp:3358have a separate list for these connections, instead of having to loop through all of them

have a separate list for these connections, instead of having to loop through all of them

../src/session_impl.cpp:3358

		if (m_auto_manage_time_scaler < 0)
 		{
 			INVARIANT_CHECK;
 			m_auto_manage_time_scaler = settings().get_int(settings_pack::auto_manage_interval);
@@ -4428,7 +4374,7 @@ retry:
 
 #ifndef TORRENT_DISABLE_DHT
 		if (m_dht)
-
relevance 0../src/session_impl.cpp:3399this should apply to all bandwidth channels

this should apply to all bandwidth channels

../src/session_impl.cpp:3399

			t.second_tick(tick_interval_ms, m_tick_residual / 1000);
+
relevance 0../src/session_impl.cpp:3399this should apply to all bandwidth channels

this should apply to all bandwidth channels

../src/session_impl.cpp:3399

			t.second_tick(tick_interval_ms, m_tick_residual / 1000);
 
 			// if the call to second_tick caused the torrent
 			// to no longer want to be ticked (i.e. it was
@@ -4479,7 +4425,7 @@ retry:
 				&& m_stat.upload_ip_overhead() >= up_limit
 				&& m_alerts.should_post<performance_alert>())
 			{
-
relevance 0../src/session_impl.cpp:4461these vectors could be copied from m_torrent_lists, if we would maintain them. That way the first pass over all torrents could be avoided. It would be especially efficient if most torrents are not auto-managed whenever we receive a scrape response (or anything that may change the rank of a torrent) that one torrent could re-sort itself in a list that's kept sorted at all times. That way, this pass over all torrents could be avoided alltogether.

these vectors could be copied from m_torrent_lists, +

relevance 0../src/session_impl.cpp:4461these vectors could be copied from m_torrent_lists, if we would maintain them. That way the first pass over all torrents could be avoided. It would be especially efficient if most torrents are not auto-managed whenever we receive a scrape response (or anything that may change the rank of a torrent) that one torrent could re-sort itself in a list that's kept sorted at all times. That way, this pass over all torrents could be avoided alltogether.

these vectors could be copied from m_torrent_lists, if we would maintain them. That way the first pass over all torrents could be avoided. It would be especially efficient if most torrents are not auto-managed @@ -4538,7 +4484,7 @@ avoided alltogether.

../src/session_impl.cpp:4461

relevance 0../src/session_impl.cpp:4536allow extensions to sort torrents for queuing

allow extensions to sort torrents for queuing

../src/session_impl.cpp:4536

				if (t->is_finished())
+
relevance 0../src/session_impl.cpp:4536allow extensions to sort torrents for queuing

allow extensions to sort torrents for queuing

../src/session_impl.cpp:4536

				if (t->is_finished())
 					seeds.push_back(t);
 				else
 					downloaders.push_back(t);
@@ -4589,7 +4535,7 @@ avoided alltogether.

../src/session_impl.cpp:4461

relevance 0../src/session_impl.cpp:4708use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections

use a lower limit than m_settings.connections_limit +

relevance 0../src/session_impl.cpp:4708use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections

use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections

../src/session_impl.cpp:4708

		// robin fashion, so that every torrent is equally likely to connect to a
 		// peer
@@ -4642,7 +4588,7 @@ connections

../src/session_impl.cpp:4708

relevance 0../src/session_impl.cpp:4869post a message to have this happen immediately instead of waiting for the next tick

post a message to have this happen +

relevance 0../src/session_impl.cpp:4869post a message to have this happen immediately instead of waiting for the next tick

post a message to have this happen immediately instead of waiting for the next tick

../src/session_impl.cpp:4869

						// we've unchoked this peer, and it hasn't reciprocated
 						// we may want to increase our estimated reciprocation rate
 						p->increase_est_reciprocation_rate();
@@ -4694,7 +4640,7 @@ immediately instead of waiting for the next tick

../src/session_impl.cpp prev = i; } #endif -

relevance 0../src/session_impl.cpp:4903make configurable

make configurable

../src/session_impl.cpp:4903

+
relevance 0../src/session_impl.cpp:4903make configurable

make configurable

../src/session_impl.cpp:4903

 #ifdef TORRENT_DEBUG
 			for (std::vector<peer_connection*>::const_iterator i = peers.begin()
 				, end(peers.end()), prev(peers.end()); i != end; ++i)
@@ -4727,7 +4673,7 @@ immediately instead of waiting for the next tick

../src/session_impl.cpp ++m_allowed_upload_slots; -

relevance 0../src/session_impl.cpp:4917make configurable

make configurable

../src/session_impl.cpp:4917

						>= (*i)->uploaded_in_last_round() * 1000
+
relevance 0../src/session_impl.cpp:4917make configurable

make configurable

../src/session_impl.cpp:4917

						>= (*i)->uploaded_in_last_round() * 1000
 						* (1 + t2->priority()) / total_milliseconds(unchoke_interval));
 				}
 				prev = i;
@@ -4778,7 +4724,7 @@ immediately instead of waiting for the next tick

../src/session_impl.cpp { // if our current upload rate is less than 90% of our // limit -

relevance 0../src/session_impl.cpp:4996this should be called for all peers!

this should be called for all peers!

../src/session_impl.cpp:4996

				// we don't know at what rate we can upload. If we have a
+
relevance 0../src/session_impl.cpp:4996this should be called for all peers!

this should be called for all peers!

../src/session_impl.cpp:4996

				// we don't know at what rate we can upload. If we have a
 				// measurement of the peak, use that + 10kB/s, otherwise
 				// assume 20 kB/s
 				upload_capacity_left = (std::max)(20000, m_peak_up_rate + 10000);
@@ -4829,7 +4775,7 @@ immediately instead of waiting for the next tick

../src/session_impl.cpp --unchoke_set_size; TORRENT_ASSERT(p->peer_info_struct()); -

relevance 0../src/session_impl.cpp:5411it might be a nice feature here to limit the number of torrents to send in a single update. By just posting the first n torrents, they would nicely be round-robined because the torrent lists are always pushed back

it might be a nice feature here to limit the number of torrents +

relevance 0../src/session_impl.cpp:5411it might be a nice feature here to limit the number of torrents to send in a single update. By just posting the first n torrents, they would nicely be round-robined because the torrent lists are always pushed back

it might be a nice feature here to limit the number of torrents to send in a single update. By just posting the first n torrents, they would nicely be round-robined because the torrent lists are always pushed back

../src/session_impl.cpp:5411

			t->status(&*i, flags);
@@ -4882,7 +4828,7 @@ pushed back

../src/session_impl.cpp:5411

relevance 0../src/storage.cpp:710make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info

make this more generic to not just work if files have been +

relevance 0../src/storage.cpp:710make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info

make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info

../src/storage.cpp:710

		for (;;)
 		{
@@ -4935,7 +4881,7 @@ maybe use the same format as .torrent files and reuse some code from torrent_inf
 		if (file_sizes_ent->list_size() == 0)
 		{
 			ec.ec = errors::no_files_in_resume_data;
-
relevance 0../src/storage.cpp:1006if everything moves OK, except for the partfile we currently won't update the save path, which breaks things. it would probably make more sense to give up on the partfile

if everything moves OK, except for the partfile +

relevance 0../src/storage.cpp:1006if everything moves OK, except for the partfile we currently won't update the save path, which breaks things. it would probably make more sense to give up on the partfile

if everything moves OK, except for the partfile we currently won't update the save path, which breaks things. it would probably make more sense to give up on the partfile

../src/storage.cpp:1006

					if (ec)
 					{
@@ -4988,7 +4934,7 @@ it would probably make more sense to give up on the partfile

../src/stor { fileop op = { &file::writev , file::read_write | flags }; -

relevance 0../src/torrent.cpp:491if the existing torrent doesn't have metadata, insert the metadata we just downloaded into it.

if the existing torrent doesn't have metadata, insert +

relevance 0../src/torrent.cpp:491if the existing torrent doesn't have metadata, insert the metadata we just downloaded into it.

if the existing torrent doesn't have metadata, insert the metadata we just downloaded into it.

../src/torrent.cpp:491

 		m_torrent_file = tf;
 
@@ -5040,7 +4986,7 @@ the metadata we just downloaded into it.

../src/torrent.cpp:491

relevance 0../src/torrent.cpp:641if the existing torrent doesn't have metadata, insert the metadata we just downloaded into it.

if the existing torrent doesn't have metadata, insert +

relevance 0../src/torrent.cpp:641if the existing torrent doesn't have metadata, insert the metadata we just downloaded into it.

if the existing torrent doesn't have metadata, insert the metadata we just downloaded into it.

../src/torrent.cpp:641

 		m_torrent_file = tf;
 
@@ -5092,7 +5038,7 @@ the metadata we just downloaded into it.

../src/torrent.cpp:641

relevance 0../src/torrent.cpp:1446is verify_peer_cert called once per certificate in the chain, and this function just tells us which depth we're at right now? If so, the comment makes sense. any certificate that isn't the leaf (i.e. the one presented by the peer) should be accepted automatically, given preverified is true. The leaf certificate need to be verified to make sure its DN matches the info-hash

is verify_peer_cert called once per certificate in the chain, and +

relevance 0../src/torrent.cpp:1446is verify_peer_cert called once per certificate in the chain, and this function just tells us which depth we're at right now? If so, the comment makes sense. any certificate that isn't the leaf (i.e. the one presented by the peer) should be accepted automatically, given preverified is true. The leaf certificate need to be verified to make sure its DN matches the info-hash

is verify_peer_cert called once per certificate in the chain, and this function just tells us which depth we're at right now? If so, the comment makes sense. any certificate that isn't the leaf (i.e. the one presented by the peer) @@ -5148,7 +5094,7 @@ need to be verified to make sure its DN matches the info-hash

../src/tor { #if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) match = true; -

relevance 0../src/torrent.cpp:1838instead of creating the picker up front here, maybe this whole section should move to need_picker()

instead of creating the picker up front here, +

relevance 0../src/torrent.cpp:1838instead of creating the picker up front here, maybe this whole section should move to need_picker()

instead of creating the picker up front here, maybe this whole section should move to need_picker()

../src/torrent.cpp:1838

			else
 			{
 				read_resume_data(m_resume_data->entry);
@@ -5200,7 +5146,7 @@ maybe this whole section should move to need_picker()

../src/torrent.cpp // need to consider it finished std::vector<piece_picker::downloading_piece> dq -

relevance 0../src/torrent.cpp:2034there may be peer extensions relying on the torrent extension still being alive. Only do this if there are no peers. And when the last peer is disconnected, if the torrent is unloaded, clear the extensions m_extensions.clear();

there may be peer extensions relying on the torrent extension +

relevance 0../src/torrent.cpp:2034there may be peer extensions relying on the torrent extension still being alive. Only do this if there are no peers. And when the last peer is disconnected, if the torrent is unloaded, clear the extensions m_extensions.clear();

there may be peer extensions relying on the torrent extension still being alive. Only do this if there are no peers. And when the last peer is disconnected, if the torrent is unloaded, clear the extensions m_extensions.clear();

../src/torrent.cpp:2034

		// pinned torrents are not allowed to be swapped out
@@ -5254,7 +5200,7 @@ m_extensions.clear();

../src/torrent.cpp:2034

relevance 0../src/torrent.cpp:2707this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated listen port

this pattern is repeated in a few places. Factor this into +

relevance 0../src/torrent.cpp:2707this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated listen port

this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated listen port

../src/torrent.cpp:2707

		// if the files haven't been checked yet, we're
 		// not ready for peers. Except, if we don't have metadata,
@@ -5307,7 +5253,7 @@ dedicated listen port

../src/torrent.cpp:2707

relevance 0../src/torrent.cpp:3481add one peer per IP the hostname resolves to

add one peer per IP the hostname resolves to

../src/torrent.cpp:3481

#endif
+
relevance 0../src/torrent.cpp:3481add one peer per IP the hostname resolves to

add one peer per IP the hostname resolves to

../src/torrent.cpp:3481

#endif
 
 	void torrent::on_peer_name_lookup(error_code const& e
 		, std::vector<address> const& host_list, int port)
@@ -5358,7 +5304,7 @@ dedicated listen port

../src/torrent.cpp:2707

relevance 0../src/torrent.cpp:4472update suggest_piece?

update suggest_piece?

../src/torrent.cpp:4472

+
relevance 0../src/torrent.cpp:4472update suggest_piece?

update suggest_piece?

../src/torrent.cpp:4472

 	void torrent::peer_has_all(peer_connection const* peer)
 	{
 		if (has_picker())
@@ -5409,7 +5355,7 @@ dedicated listen port

../src/torrent.cpp:2707

relevance 0../src/torrent.cpp:4615really, we should just keep the picker around in this case to maintain the availability counters

really, we should just keep the picker around +

relevance 0../src/torrent.cpp:4615really, we should just keep the picker around in this case to maintain the availability counters

really, we should just keep the picker around in this case to maintain the availability counters

../src/torrent.cpp:4615

		pieces.reserve(cs.pieces.size());
 
 		// sort in ascending order, to get most recently used first
@@ -5461,12 +5407,12 @@ in this case to maintain the availability counters

../src/torrent.cpp:46 } void torrent::abort() -

relevance 0../src/torrent.cpp:6546make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info The mapped_files needs to be read both in the network thread and in the disk thread, since they both have their own mapped files structures which are kept in sync

make this more generic to not just work if files have been +

relevance 0../src/torrent.cpp:6547make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info The mapped_files needs to be read both in the network thread and in the disk thread, since they both have their own mapped files structures which are kept in sync

make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info The mapped_files needs to be read both in the network thread and in the disk thread, since they both have their own mapped files structures -which are kept in sync

../src/torrent.cpp:6546

		super_seeding(rd.dict_find_int_value("super_seeding", 0));
+which are kept in sync

../src/torrent.cpp:6547

		super_seeding(rd.dict_find_int_value("super_seeding", 0));
 
 		if (!m_use_resume_save_path)
 		{
@@ -5517,12 +5463,12 @@ which are kept in sync

../src/torrent.cpp:6546

relevance 0../src/torrent.cpp:6709if this is a merkle torrent and we can't restore the tree, we need to wipe all the bits in the have array, but not necessarily we might want to do a full check to see if we have all the pieces. This is low priority since almost no one uses merkle torrents

if this is a merkle torrent and we can't +

relevance 0../src/torrent.cpp:6710if this is a merkle torrent and we can't restore the tree, we need to wipe all the bits in the have array, but not necessarily we might want to do a full check to see if we have all the pieces. This is low priority since almost no one uses merkle torrents

if this is a merkle torrent and we can't restore the tree, we need to wipe all the bits in the have array, but not necessarily we might want to do a full check to see if we have all the pieces. This is low priority since almost -no one uses merkle torrents

../src/torrent.cpp:6709

				add_web_seed(url, web_seed_entry::http_seed);
+no one uses merkle torrents

../src/torrent.cpp:6710

				add_web_seed(url, web_seed_entry::http_seed);
 			}
 		}
 
@@ -5573,9 +5519,9 @@ no one uses merkle torrents

../src/torrent.cpp:6709

relevance 0../src/torrent.cpp:6899make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance. using file_base

make this more generic to not just work if files have been +

relevance 0../src/torrent.cpp:6900make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance. using file_base

make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance. -using file_base

../src/torrent.cpp:6899

		pieces.resize(m_torrent_file->num_pieces());
+using file_base

../src/torrent.cpp:6900

		pieces.resize(m_torrent_file->num_pieces());
 		if (!has_picker())
 		{
 			std::memset(&pieces[0], m_have_all, pieces.size());
@@ -5626,9 +5572,9 @@ using file_base

../src/torrent.cpp:6899

relevance 0../src/torrent.cpp:8867add a flag to ignore stats, and only care about resume data for content. For unchanged files, don't trigger a load of the metadata just to save an empty resume data file

add a flag to ignore stats, and only care about resume data for +

relevance 0../src/torrent.cpp:8868add a flag to ignore stats, and only care about resume data for content. For unchanged files, don't trigger a load of the metadata just to save an empty resume data file

add a flag to ignore stats, and only care about resume data for content. For unchanged files, don't trigger a load of the metadata -just to save an empty resume data file

../src/torrent.cpp:8867

		if (m_complete != 0xffffff) seeds = m_complete;
+just to save an empty resume data file

../src/torrent.cpp:8868

		if (m_complete != 0xffffff) seeds = m_complete;
 		else seeds = m_policy ? m_policy->num_seeds() : 0;
 
 		if (m_incomplete != 0xffffff) downloaders = m_incomplete;
@@ -5679,10 +5625,10 @@ just to save an empty resume data file

../src/torrent.cpp:8867

relevance 0../src/torrent.cpp:9838go through the pieces we have and count the total number of downloaders we have. Only count peers that are interested in us since some peers might not send have messages for pieces we have it num_interested == 0, we need to pick a new piece

go through the pieces we have and count the total number +

relevance 0../src/torrent.cpp:9826go through the pieces we have and count the total number of downloaders we have. Only count peers that are interested in us since some peers might not send have messages for pieces we have it num_interested == 0, we need to pick a new piece

go through the pieces we have and count the total number of downloaders we have. Only count peers that are interested in us since some peers might not send have messages for pieces we have -it num_interested == 0, we need to pick a new piece

../src/torrent.cpp:9838

			}
+it num_interested == 0, we need to pick a new piece

../src/torrent.cpp:9826

			}
 
 			rarest_pieces.clear();
 			rarest_rarity = pp.peer_count;
@@ -5733,8 +5679,8 @@ it num_interested == 0, we need to pick a new piece

../src/torrent.cpp:9 if (num_cache_pieces > m_torrent_file->num_pieces()) num_cache_pieces = m_torrent_file->num_pieces(); -

relevance 0../src/torrent.cpp:10484instead of resorting the whole list, insert the peers directly into the right place

instead of resorting the whole list, insert the peers -directly into the right place

../src/torrent.cpp:10484

				printf("timed out [average-piece-time: %d ms ]\n"
+
relevance 0../src/torrent.cpp:10472instead of resorting the whole list, insert the peers directly into the right place

instead of resorting the whole list, insert the peers +directly into the right place

../src/torrent.cpp:10472

				printf("timed out [average-piece-time: %d ms ]\n"
 					, m_average_piece_time);
 #endif
 			}
@@ -5785,7 +5731,7 @@ directly into the right place

../src/torrent.cpp:10484

relevance 0../src/torrent_peer.cpp:176how do we deal with our external address changing?

how do we deal with our external address changing?

../src/torrent_peer.cpp:176

		, is_v6_addr(false)
+
relevance 0../src/torrent_peer.cpp:176how do we deal with our external address changing?

how do we deal with our external address changing?

../src/torrent_peer.cpp:176

		, is_v6_addr(false)
 #endif
 #if TORRENT_USE_I2P
 		, is_i2p_addr(false)
@@ -5836,7 +5782,7 @@ directly into the right place

../src/torrent.cpp:10484

relevance 0../src/udp_socket.cpp:286it would be nice to detect this on posix systems also

it would be nice to detect this on posix systems also

../src/udp_socket.cpp:286

		--m_v6_outstanding;
+
relevance 0../src/udp_socket.cpp:286it would be nice to detect this on posix systems also

it would be nice to detect this on posix systems also

../src/udp_socket.cpp:286

		--m_v6_outstanding;
 	}
 	else
 #endif
@@ -5887,7 +5833,7 @@ void udp_socket::call_handler(error_code const& ec, udp::endpoint const&
 			ret = (*i)->incoming_packet(ec, ep, buf, size);
 		} TORRENT_CATCH (std::exception&) {}
 		if (*i == NULL) i = m_observers.erase(i);
-
relevance 0../src/upnp.cpp:71listen_interface is not used. It's meant to bind the broadcast socket

listen_interface is not used. It's meant to bind the broadcast socket

../src/upnp.cpp:71

#include <asio/ip/multicast.hpp>
+
relevance 0../src/upnp.cpp:71listen_interface is not used. It's meant to bind the broadcast socket

listen_interface is not used. It's meant to bind the broadcast socket

../src/upnp.cpp:71

#include <asio/ip/multicast.hpp>
 #else
 #include <boost/asio/ip/host_name.hpp>
 #include <boost/asio/ip/multicast.hpp>
@@ -5938,7 +5884,7 @@ static error_code ec;
 		m_devices.swap(s->devices);
 		m_mappings.swap(s->mappings);
 		delete s;
-
relevance 0../src/ut_metadata.cpp:320we really need to increment the refcounter on the torrent while this buffer is still in the peer's send buffer

we really need to increment the refcounter on the torrent +

relevance 0../src/ut_metadata.cpp:320we really need to increment the refcounter on the torrent while this buffer is still in the peer's send buffer

we really need to increment the refcounter on the torrent while this buffer is still in the peer's send buffer

../src/ut_metadata.cpp:320

				if (!m_tp.need_loaded()) return;
 				metadata = m_tp.metadata().begin + offset;
 				metadata_piece_size = (std::min)(
@@ -5990,7 +5936,7 @@ while this buffer is still in the peer's send buffer

../src/ut_metadata. #ifdef TORRENT_VERBOSE_LOGGING m_pc.peer_log("<== UT_METADATA [ not a dictionary ]"); #endif -

relevance 0../src/utp_stream.cpp:1627this loop may not be very efficient

this loop may not be very efficient

../src/utp_stream.cpp:1627

+
relevance 0../src/utp_stream.cpp:1627this loop may not be very efficient

this loop may not be very efficient

../src/utp_stream.cpp:1627

 	char* m_buf;
 };
 
@@ -6041,7 +5987,7 @@ bool utp_socket_impl::send_pkt(int flags)
 		if (sack > 32) sack = 32;
 	}
 
-
relevance 0../src/web_connection_base.cpp:73introduce a web-seed default class which has a low download priority

introduce a web-seed default class which has a low download priority

../src/web_connection_base.cpp:73

{
+
relevance 0../src/web_connection_base.cpp:73introduce a web-seed default class which has a low download priority

introduce a web-seed default class which has a low download priority

../src/web_connection_base.cpp:73

{
 	web_connection_base::web_connection_base(
 		peer_connection_args const& pack
 		, web_seed_entry& web)
@@ -6092,7 +6038,7 @@ bool utp_socket_impl::send_pkt(int flags)
 		// according to the settings.
 		return m_settings.get_int(settings_pack::urlseed_timeout);
 	}
-
relevance 0../src/kademlia/dht_tracker.cpp:428ideally this function would be called when the put completes

ideally this function would be called when the +

relevance 0../src/kademlia/dht_tracker.cpp:428ideally this function would be called when the put completes

ideally this function would be called when the put completes

../src/kademlia/dht_tracker.cpp:428

		// since it controls whether we re-put the content
 		TORRENT_ASSERT(!it.is_mutable());
 		f(it);
@@ -6144,7 +6090,7 @@ put completes

../src/kademlia/dht_tracker.cpp:428

relevance 0../src/kademlia/routing_table.cpp:316instad of refreshing a bucket by using find_nodes, ping each node periodically

instad of refreshing a bucket by using find_nodes, +

relevance 0../src/kademlia/routing_table.cpp:316instad of refreshing a bucket by using find_nodes, ping each node periodically

instad of refreshing a bucket by using find_nodes, ping each node periodically

../src/kademlia/routing_table.cpp:316

		os << "]\n";
 	}
 }
@@ -6196,7 +6142,7 @@ bool compare_bucket_refresh(routing_table_node const& lhs, routing_table_nod
 	node_id mask = generate_prefix_mask(num_bits);
 
 	// target = (target & ~mask) | (root & mask)
-
relevance 0../include/libtorrent/bitfield.hpp:158rename to data() ?

rename to data() ?

../include/libtorrent/bitfield.hpp:158

				if (m_buf[i] != 0) return false;
+
relevance 0../include/libtorrent/bitfield.hpp:158rename to data() ?

rename to data() ?

../include/libtorrent/bitfield.hpp:158

				if (m_buf[i] != 0) return false;
 			}
 			return true;
 		}
@@ -6247,7 +6193,7 @@ bool compare_bucket_refresh(routing_table_node const& lhs, routing_table_nod
 				return ret;
 			}	
 #endif // TORRENT_HAS_SSE
-
relevance 0../include/libtorrent/block_cache.hpp:218make this 32 bits and to count seconds since the block cache was created

make this 32 bits and to count seconds since the block cache was created

../include/libtorrent/block_cache.hpp:218

		bool operator==(cached_piece_entry const& rhs) const
+
relevance 0../include/libtorrent/block_cache.hpp:218make this 32 bits and to count seconds since the block cache was created

make this 32 bits and to count seconds since the block cache was created

../include/libtorrent/block_cache.hpp:218

		bool operator==(cached_piece_entry const& rhs) const
 		{ return storage.get() == rhs.storage.get() && piece == rhs.piece; }
 
 		// if this is set, we'll be calculating the hash
@@ -6298,7 +6244,7 @@ bool compare_bucket_refresh(routing_table_node const& lhs, routing_table_nod
 
 		// this is set to true once we flush blocks past
 		// the hash cursor. Once this happens, there's
-
relevance 0../include/libtorrent/config.hpp:339Make this count Unicode characters instead of bytes on windows

Make this count Unicode characters instead of bytes on windows

../include/libtorrent/config.hpp:339

#define TORRENT_USE_WRITEV 0
+
relevance 0../include/libtorrent/config.hpp:339Make this count Unicode characters instead of bytes on windows

Make this count Unicode characters instead of bytes on windows

../include/libtorrent/config.hpp:339

#define TORRENT_USE_WRITEV 0
 #define TORRENT_USE_READV 0
 
 #else
@@ -6349,7 +6295,7 @@ bool compare_bucket_refresh(routing_table_node const& lhs, routing_table_nod
 #include <stdarg.h>
 
 // internal
-
relevance 0../include/libtorrent/debug.hpp:215rewrite this class to use FILE* instead and have a printf-like interface

rewrite this class to use FILE* instead and +

relevance 0../include/libtorrent/debug.hpp:215rewrite this class to use FILE* instead and have a printf-like interface

rewrite this class to use FILE* instead and have a printf-like interface

../include/libtorrent/debug.hpp:215

#endif
 }
 
@@ -6401,7 +6347,7 @@ namespace libtorrent
 
 			mutex::scoped_lock l(file_mutex);
 			open(!append);
-
relevance 0../include/libtorrent/disk_buffer_pool.hpp:133try to remove the observers, only using the async_allocate handlers

try to remove the observers, only using the async_allocate handlers

../include/libtorrent/disk_buffer_pool.hpp:133

+
relevance 0../include/libtorrent/disk_buffer_pool.hpp:133try to remove the observers, only using the async_allocate handlers

try to remove the observers, only using the async_allocate handlers

../include/libtorrent/disk_buffer_pool.hpp:133

 		// number of bytes per block. The BitTorrent
 		// protocol defines the block size to 16 KiB.
 		const int m_block_size;
@@ -6452,7 +6398,7 @@ namespace libtorrent
 		// the pointer to the block of virtual address space
 		// making up the mmapped cache space
 		char* m_cache_pool;
-
relevance 0../include/libtorrent/peer_connection.hpp:216make this a raw pointer (to save size in the first cache line) and make the constructor take a raw pointer. torrent objects should always outlive their peers

make this a raw pointer (to save size in +

relevance 0../include/libtorrent/peer_connection.hpp:216make this a raw pointer (to save size in the first cache line) and make the constructor take a raw pointer. torrent objects should always outlive their peers

make this a raw pointer (to save size in the first cache line) and make the constructor take a raw pointer. torrent objects should always outlive their peers

../include/libtorrent/peer_connection.hpp:216

			, m_snubbed(false)
@@ -6506,7 +6452,7 @@ outlive their peers

../include/libtorrent/peer_connection.hpp:216

relevance 0../include/libtorrent/peer_connection.hpp:1123factor this out into its own class with a virtual interface torrent and session should implement this interface

factor this out into its own class with a virtual interface +

relevance 0../include/libtorrent/peer_connection.hpp:1123factor this out into its own class with a virtual interface torrent and session should implement this interface

factor this out into its own class with a virtual interface torrent and session should implement this interface

../include/libtorrent/peer_connection.hpp:1123

 		// the local endpoint for this peer, i.e. our address
 		// and our port. If this is set for outgoing connections
@@ -6558,7 +6504,7 @@ torrent and session should implement this interface

../include/libtorren // | // | m_recv_start (logical start of current // | | receive buffer, as perceived by upper layers) -

relevance 0../include/libtorrent/peer_connection_interface.hpp:45make this interface smaller!

make this interface smaller!

../include/libtorrent/peer_connection_interface.hpp:45

SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+
relevance 0../include/libtorrent/peer_connection_interface.hpp:45make this interface smaller!

make this interface smaller!

../include/libtorrent/peer_connection_interface.hpp:45

SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
@@ -6609,7 +6555,7 @@ namespace libtorrent
 		virtual tcp::endpoint const& remote() const = 0;
 		virtual tcp::endpoint local_endpoint() const = 0;
 		virtual void disconnect(error_code const& ec, operation_t op, int error = 0) = 0;
-
relevance 0../include/libtorrent/performance_counters.hpp:132should keepalives be in here too? how about dont-have, share-mode, upload-only

should keepalives be in here too? +

relevance 0../include/libtorrent/performance_counters.hpp:132should keepalives be in here too? how about dont-have, share-mode, upload-only

should keepalives be in here too? how about dont-have, share-mode, upload-only

../include/libtorrent/performance_counters.hpp:132

			// a connect candidate
 			connection_attempt_loops,
 			// successful incoming connections (not rejected for any reason)
@@ -6661,7 +6607,7 @@ how about dont-have, share-mode, upload-only

../include/libtorrent/perfo num_outgoing_cancel, num_outgoing_dht_port, num_outgoing_suggest, -

relevance 0../include/libtorrent/performance_counters.hpp:406some space could be saved here by making gauges 32 bits

some space could be saved here by making gauges 32 bits

../include/libtorrent/performance_counters.hpp:406

relevance 0../include/libtorrent/performance_counters.hpp:407restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization points

restore these to regular integers. Instead have one copy +

relevance 0../include/libtorrent/performance_counters.hpp:406some space could be saved here by making gauges 32 bits

some space could be saved here by making gauges 32 bits

../include/libtorrent/performance_counters.hpp:406

relevance 0../include/libtorrent/performance_counters.hpp:407restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization points

restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization points

../include/libtorrent/performance_counters.hpp:407

			limiter_down_bytes,
 
@@ -6696,7 +6642,7 @@ synchronization points

../include/libtorrent/performance_counters.hpp:40 #endif -

relevance 0../include/libtorrent/piece_picker.hpp:669should this be allocated lazily?

should this be allocated lazily?

../include/libtorrent/piece_picker.hpp:669

		std::vector<downloading_piece>::const_iterator find_dl_piece(int queue, int index) const;
+
relevance 0../include/libtorrent/piece_picker.hpp:669should this be allocated lazily?

should this be allocated lazily?

../include/libtorrent/piece_picker.hpp:669

		std::vector<downloading_piece>::const_iterator find_dl_piece(int queue, int index) const;
 		std::vector<downloading_piece>::iterator find_dl_piece(int queue, int index);
 
 		// returns an iterator to the downloading piece, whichever
@@ -6747,7 +6693,7 @@ synchronization points

../include/libtorrent/performance_counters.hpp:40 // and some are still in the requested state // 2: downloading pieces where every block is // finished or writing -

relevance 0../include/libtorrent/proxy_base.hpp:166it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec);

it would be nice to remember the bind port and bind once we know where the proxy is +

relevance 0../include/libtorrent/proxy_base.hpp:166it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec);

it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec);

../include/libtorrent/proxy_base.hpp:166

	{
 		return m_sock.get_option(opt, ec);
 	}
@@ -6799,7 +6745,7 @@ m_sock.bind(endpoint, ec);

../include/libtorrent/proxy_base.hpp:166

m_sock.close(ec); m_resolver.cancel(); } -
relevance 0../include/libtorrent/session.hpp:861add get_peer_class_type_filter() as well

add get_peer_class_type_filter() as well

../include/libtorrent/session.hpp:861

		// 
+
relevance 0../include/libtorrent/session.hpp:861add get_peer_class_type_filter() as well

add get_peer_class_type_filter() as well

../include/libtorrent/session.hpp:861

		// 
 		// The ``peer_class`` argument cannot be greater than 31. The bitmasks
 		// representing peer classes in the ``peer_class_filter`` are 32 bits.
 		// 
@@ -6850,7 +6796,7 @@ m_sock.bind(endpoint, ec);

../include/libtorrent/proxy_base.hpp:166

// destructs. // // For more information on peer classes, see peer-classes_. -
relevance 0../include/libtorrent/settings_pack.hpp:1080deprecate this ``max_rejects`` is the number of piece requests we will reject in a row while a peer is choked before the peer is considered abusive and is disconnected.

deprecate this +

relevance 0../include/libtorrent/settings_pack.hpp:1080deprecate this ``max_rejects`` is the number of piece requests we will reject in a row while a peer is choked before the peer is considered abusive and is disconnected.

deprecate this ``max_rejects`` is the number of piece requests we will reject in a row while a peer is choked before the peer is considered abusive and is disconnected.

../include/libtorrent/settings_pack.hpp:1080

			auto_manage_startup,
@@ -6904,7 +6850,7 @@ disconnected.

../include/libtorrent/settings_pack.hpp:1080

relevance 0../include/libtorrent/size_type.hpp:48remove these and just use boost's types directly

remove these and just use boost's types directly

../include/libtorrent/size_type.hpp:48

ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+
relevance 0../include/libtorrent/size_type.hpp:48remove these and just use boost's types directly

remove these and just use boost's types directly

../include/libtorrent/size_type.hpp:48

ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 
 */
@@ -6930,17 +6876,17 @@ namespace libtorrent
 
 
 #endif
-
relevance 0../include/libtorrent/torrent.hpp:1200this wastes 5 bits per file

this wastes 5 bits per file

../include/libtorrent/torrent.hpp:1200

		// with fatal errors are removed from the set
-		std::list<web_seed_entry> m_web_seeds;
-
-#ifndef TORRENT_DISABLE_EXTENSIONS
-		typedef std::list<boost::shared_ptr<torrent_plugin> > extension_list_t;
+
relevance 0../include/libtorrent/torrent.hpp:1212this wastes 5 bits per file

this wastes 5 bits per file

../include/libtorrent/torrent.hpp:1212

		typedef std::list<boost::shared_ptr<torrent_plugin> > extension_list_t;
 		extension_list_t m_extensions;
 #endif
 
 		// used for tracker announces
 		deadline_timer m_tracker_timer;
 
+		// used to detect when we are active or inactive for long enough
+		// to trigger the auto-manage logic
+		deadline_timer m_inactivity_timer;
+
 		// this is the upload and download statistics for the whole torrent.
 		// it's updated from all its peers once every second.
 		libtorrent::stat m_stat;
@@ -6981,7 +6927,7 @@ namespace libtorrent
 
 		// if this was added from an RSS feed, this is the unique
 		// identifier in the feed.
-
relevance 0../include/libtorrent/torrent.hpp:1259These two bitfields should probably be coalesced into one

These two bitfields should probably be coalesced into one

../include/libtorrent/torrent.hpp:1259

		// the .torrent file from m_url
+
relevance 0../include/libtorrent/torrent.hpp:1271These two bitfields should probably be coalesced into one

These two bitfields should probably be coalesced into one

../include/libtorrent/torrent.hpp:1271

		// the .torrent file from m_url
 //		std::vector<char> m_torrent_file_buf;
 
 		// this is a list of all pieces that we have announced
@@ -7032,7 +6978,7 @@ namespace libtorrent
 		// this is the time last any of our peers saw a seed
 		// in this swarm
 		time_t m_swarm_last_seen_complete;
-
relevance 0../include/libtorrent/torrent_info.hpp:124include the number of peers received from this tracker, at last announce

include the number of peers received from this tracker, at last announce

../include/libtorrent/torrent_info.hpp:124

+
relevance 0../include/libtorrent/torrent_info.hpp:124include the number of peers received from this tracker, at last announce

include the number of peers received from this tracker, at last announce

../include/libtorrent/torrent_info.hpp:124

 		// if this tracker failed the last time it was contacted
 		// this error code specifies what error occurred
 		error_code last_error;
@@ -7083,7 +7029,7 @@ namespace libtorrent
 		// flags for the source bitmask, each indicating where
 		// we heard about this tracker
 		enum tracker_source
-
relevance 0../include/libtorrent/upnp.hpp:112support using the windows API for UPnP operations as well

support using the windows API for UPnP operations as well

../include/libtorrent/upnp.hpp:112

			// specific port
+
relevance 0../include/libtorrent/upnp.hpp:112support using the windows API for UPnP operations as well

support using the windows API for UPnP operations as well

../include/libtorrent/upnp.hpp:112

			// specific port
 			external_port_must_be_wildcard = 727
 		};
 
@@ -7134,7 +7080,7 @@ public:
 	// is -1, which means failure. There will not be any error alert notification for
 	// mappings that fail with a -1 return value.
 	int add_mapping(protocol_type p, int external_port, int local_port);
-
relevance 0../include/libtorrent/utp_stream.hpp:390implement blocking write. Low priority since it's not used (yet)

implement blocking write. Low priority since it's not used (yet)

../include/libtorrent/utp_stream.hpp:390

		for (typename Mutable_Buffers::const_iterator i = buffers.begin()
+
relevance 0../include/libtorrent/utp_stream.hpp:390implement blocking write. Low priority since it's not used (yet)

implement blocking write. Low priority since it's not used (yet)

../include/libtorrent/utp_stream.hpp:390

		for (typename Mutable_Buffers::const_iterator i = buffers.begin()
 			, end(buffers.end()); i != end; ++i)
 		{
 			using asio::buffer_cast;
@@ -7185,7 +7131,7 @@ public:
 		if (m_impl == 0)
 		{
 			m_io_service.post(boost::bind<void>(handler, asio::error::not_connected, 0));
-
relevance 0../include/libtorrent/kademlia/item.hpp:61since this is a public function, it should probably be moved out of this header and into one with other public functions.

since this is a public function, it should probably be moved +

relevance 0../include/libtorrent/kademlia/item.hpp:61since this is a public function, it should probably be moved out of this header and into one with other public functions.

since this is a public function, it should probably be moved out of this header and into one with other public functions.

../include/libtorrent/kademlia/item.hpp:61

#include <boost/array.hpp>
 
 namespace libtorrent { namespace dht
@@ -7237,7 +7183,7 @@ public:
 	item(entry const& v
 		, std::pair<char const*, int> salt
 		, boost::uint64_t seq, char const* pk, char const* sk);
-
relevance 0../include/libtorrent/aux_/session_impl.hpp:404move the login info into the tracker_request object

move the login info into the tracker_request object

../include/libtorrent/aux_/session_impl.hpp:404

+
relevance 0../include/libtorrent/aux_/session_impl.hpp:404move the login info into the tracker_request object

move the login info into the tracker_request object

../include/libtorrent/aux_/session_impl.hpp:404

 			void on_lsd_announce(error_code const& e);
 
 			// called when a port mapping is successful, or a router returns
@@ -7288,7 +7234,7 @@ public:
 
 #ifndef TORRENT_DISABLE_EXTENSIONS
 			void add_extensions_to_torrent(
-
relevance 0../include/libtorrent/aux_/session_impl.hpp:866should this be renamed m_outgoing_interfaces?

should this be renamed m_outgoing_interfaces?

../include/libtorrent/aux_/session_impl.hpp:866

			// listen socket. For each retry the port number
+
relevance 0../include/libtorrent/aux_/session_impl.hpp:867should this be renamed m_outgoing_interfaces?

should this be renamed m_outgoing_interfaces?

../include/libtorrent/aux_/session_impl.hpp:867

			// listen socket. For each retry the port number
 			// is incremented by one
 			int m_listen_port_retries;
 
@@ -7339,7 +7285,7 @@ public:
 			mutable boost::uint8_t m_interface_index;
 
 			void open_new_incoming_socks_connection();
-
relevance 0../include/libtorrent/aux_/session_impl.hpp:915replace this by a proper asio timer

replace this by a proper asio timer

../include/libtorrent/aux_/session_impl.hpp:915

			mutable boost::uint8_t m_interface_index;
+
relevance 0../include/libtorrent/aux_/session_impl.hpp:916replace this by a proper asio timer

replace this by a proper asio timer

../include/libtorrent/aux_/session_impl.hpp:916

			mutable boost::uint8_t m_interface_index;
 
 			void open_new_incoming_socks_connection();
 
@@ -7363,7 +7309,7 @@ public:
 
 			// this is used to decide when to recalculate which
 			// torrents to keep queued and which to activate
-
relevance 0../include/libtorrent/aux_/session_impl.hpp:920replace this by a proper asio timer

replace this by a proper asio timer

../include/libtorrent/aux_/session_impl.hpp:920

			void setup_listener(listen_socket_t* s, std::string const& device
+
relevance 0../include/libtorrent/aux_/session_impl.hpp:921replace this by a proper asio timer

replace this by a proper asio timer

../include/libtorrent/aux_/session_impl.hpp:921

			void setup_listener(listen_socket_t* s, std::string const& device
 				, bool ipv4, int port, int& retries, int flags, error_code& ec);
 
 #ifndef TORRENT_DISABLE_DHT	
@@ -7389,7 +7335,7 @@ public:
 			// is only decresed when the unchoke set
 			// is recomputed, and when it reaches zero,
 			// the optimistic unchoke is moved to another peer.
-
relevance 0../include/libtorrent/aux_/session_impl.hpp:927replace this by a proper asio timer

replace this by a proper asio timer

../include/libtorrent/aux_/session_impl.hpp:927

+
relevance 0../include/libtorrent/aux_/session_impl.hpp:928replace this by a proper asio timer

replace this by a proper asio timer

../include/libtorrent/aux_/session_impl.hpp:928

 			// the number of unchoked peers as set by the auto-unchoker
 			// this should always be >= m_max_uploads
 			int m_allowed_upload_slots;
@@ -7440,7 +7386,7 @@ public:
 			int m_suggest_timer;
 
 			// statistics gathered from all torrents.
-
relevance 0../include/libtorrent/aux_/session_interface.hpp:202it would be nice to not have this be part of session_interface

it would be nice to not have this be part of session_interface

../include/libtorrent/aux_/session_interface.hpp:202

		virtual boost::uint16_t listen_port() const = 0;
+
relevance 0../include/libtorrent/aux_/session_interface.hpp:202it would be nice to not have this be part of session_interface

it would be nice to not have this be part of session_interface

../include/libtorrent/aux_/session_interface.hpp:202

		virtual boost::uint16_t listen_port() const = 0;
 		virtual boost::uint16_t ssl_listen_port() const = 0;
 
 		// used to (potentially) issue socket write calls onto multiple threads
diff --git a/include/libtorrent/aux_/session_impl.hpp b/include/libtorrent/aux_/session_impl.hpp
index a1670af2d..d5e173317 100644
--- a/include/libtorrent/aux_/session_impl.hpp
+++ b/include/libtorrent/aux_/session_impl.hpp
@@ -672,6 +672,7 @@ namespace libtorrent
 			void update_natpmp();
 			void update_lsd();
 			void update_dht();
+			void update_count_slow();
 
 			void on_trigger_auto_manage();
 			
diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp
index 0c6376aee..48dafc92c 100644
--- a/include/libtorrent/torrent.hpp
+++ b/include/libtorrent/torrent.hpp
@@ -838,6 +838,14 @@ namespace libtorrent
 			, std::vector
const& addrs , std::list::iterator web, int port); + // re-evaluates whether this torrent should be considered inactive or not + void on_inactivity_tick(error_code const& ec); + + + // calculate the instantaneuos inactive state (the externally facing + // inactive state is not instantaneous, but low-pass filtered) + bool is_inactive_internal() const; + // remove a web seed, or schedule it for removal in case there // are outstanding operations on it void remove_web_seed(std::list::iterator web); @@ -1188,6 +1196,10 @@ namespace libtorrent // used for tracker announces deadline_timer m_tracker_timer; + // used to detect when we are active or inactive for long enough + // to trigger the auto-manage logic + deadline_timer m_inactivity_timer; + // this is the upload and download statistics for the whole torrent. // it's updated from all its peers once every second. libtorrent::stat m_stat; @@ -1634,12 +1646,10 @@ namespace libtorrent // millionths of completeness) unsigned int m_progress_ppm:20; - // the number of seconds this torrent has been under the inactive - // threshold in terms of sending and receiving data. When this counter - // reaches the settings.inactive_torrent_timeout it will be considered - // inactive and possibly open up another queue slot, to start another, - // queued, torrent. Every second it's above the threshold - boost::int16_t m_inactive_counter; + // this is a timestamp of the last time this torrent changed its + // m_inactive state. The inactive state is set when transfer rates are + // below the active threshold. It's specified in session time unit. + boost::int16_t m_last_active_change; // if this is set, accept the save path saved in the resume data, if // present diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 8886d5e6c..1919cc80c 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -6147,6 +6147,16 @@ retry: #endif } + void session_impl::update_count_slow() + { + error_code ec; + for (torrent_map::const_iterator i = m_torrents.begin() + , end(m_torrents.end()); i != end; ++i) + { + i->second->on_inactivity_tick(ec); + } + } + address session_impl::listen_address() const { for (std::list::const_iterator i = m_listen_sockets.begin() diff --git a/src/settings_pack.cpp b/src/settings_pack.cpp index 367445e46..8a7375044 100644 --- a/src/settings_pack.cpp +++ b/src/settings_pack.cpp @@ -146,7 +146,7 @@ namespace libtorrent SET(coalesce_reads, false, 0), SET(coalesce_writes, false, 0), SET(auto_manage_prefer_seeds, false, 0), - SET(dont_count_slow_torrents, true, 0), + SET(dont_count_slow_torrents, true, &session_impl::update_count_slow), SET(close_redundant_connections, true, 0), SET(prioritize_partial_pieces, false, 0), SET(rate_limit_ip_overhead, true, 0), diff --git a/src/torrent.cpp b/src/torrent.cpp index d5fd8e36e..a16980eec 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -152,6 +152,7 @@ namespace libtorrent , m_total_uploaded(0) , m_total_downloaded(0) , m_tracker_timer(ses.get_io_service()) + , m_inactivity_timer(ses.get_io_service()) , m_trackerid(p.trackerid) , m_save_path(complete(p.save_path)) , m_url(p.url) @@ -233,7 +234,6 @@ namespace libtorrent , m_downloaded(0xffffff) , m_last_scrape(0) , m_progress_ppm(0) - , m_inactive_counter(0) , m_use_resume_save_path(p.flags & add_torrent_params::flag_use_resume_save_path) { if (m_pinned) @@ -4659,9 +4659,10 @@ namespace libtorrent // if the torrent is paused, it doesn't need // to announce with even=stopped again. if (!is_paused()) - { stop_announcing(); - } + + error_code ec; + m_inactivity_timer.cancel(ec); #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING || defined TORRENT_LOGGING log_to_all_peers("ABORTING TORRENT"); @@ -7765,7 +7766,8 @@ namespace libtorrent void torrent::update_want_scrape() { - update_list(aux::session_interface::torrent_want_scrape, !m_allow_peers && m_auto_managed && !m_abort); + update_list(aux::session_interface::torrent_want_scrape + , !m_allow_peers && m_auto_managed && !m_abort); } void torrent::update_list(int list, bool in) @@ -7782,7 +7784,6 @@ namespace libtorrent if (!l.in_list()) return; l.unlink(v, list); } - } void torrent::disconnect_all(error_code const& ec, peer_connection_interface::operation_t op) @@ -9624,61 +9625,48 @@ namespace libtorrent if (m_stat.low_pass_upload_rate() > 0 || m_stat.low_pass_download_rate() > 0) state_updated(); - // TODO: 4 this logic doesn't work for seeding torrents that are not ticked - // once a torrent is inactive, it may not be ticked anymore, which may - // prevent it from ever have m_inactive be set, because there's a delay - // deom becoming inactive and trigger auto-manage. - // this section determines whether the torrent is active or not. When it // changes state, it may also trigger the auto-manage logic to reconsider // which torrents should be queued and started. There is a low pass // filter in order to avoid flapping (auto_manage_startup). - bool is_inactive = false; - if (is_finished()) - is_inactive = m_stat.upload_payload_rate() < m_ses.settings().get_int(settings_pack::inactive_up_rate); - else - is_inactive = m_stat.download_payload_rate() < m_ses.settings().get_int(settings_pack::inactive_down_rate); + bool is_inactive = is_inactive_internal(); - if (is_inactive) + if (is_inactive != m_inactive + && m_ses.settings().get_bool(settings_pack::dont_count_slow_torrents)) { - if (m_inactive_counter < 0) m_inactive_counter = 0; - if (m_inactive_counter < INT16_MAX) - { - ++m_inactive_counter; - - // if this torrent was just considered inactive, we may want - // to dequeue some other torrent - if (m_inactive == false - && m_inactive_counter >= m_ses.settings().get_int(settings_pack::auto_manage_startup)) - { - m_inactive = true; - if (m_ses.settings().get_bool(settings_pack::dont_count_slow_torrents)) - m_ses.trigger_auto_manage(); - } - } - } - else - { - if (m_inactive_counter > 0) m_inactive_counter = 0; - if (m_inactive_counter > INT16_MIN) - { - --m_inactive_counter; - - // if this torrent was just considered active, we may want - // to queue some other torrent - if (m_inactive == true - && m_inactive_counter <= -m_ses.settings().get_int(settings_pack::auto_manage_startup)) - { - m_inactive = false; - if (m_ses.settings().get_bool(settings_pack::dont_count_slow_torrents)) - m_ses.trigger_auto_manage(); - } - } + m_last_active_change = m_ses.session_time(); + int delay = m_ses.settings().get_int(settings_pack::auto_manage_startup); + m_inactivity_timer.expires_from_now(seconds(delay)); + m_inactivity_timer.async_wait(boost::bind(&torrent::on_inactivity_tick + , shared_from_this(), _1)); } update_want_tick(); } + bool torrent::is_inactive_internal() const + { + if (is_finished()) + return m_stat.upload_payload_rate() + < m_ses.settings().get_int(settings_pack::inactive_up_rate); + else + return m_stat.download_payload_rate() + < m_ses.settings().get_int(settings_pack::inactive_down_rate); + } + + void torrent::on_inactivity_tick(error_code const& ec) + { + if (ec) return; + + int now = m_ses.session_time(); + int delay = m_ses.settings().get_int(settings_pack::auto_manage_startup); + if (now - m_last_active_change < delay) return; + + m_inactive = is_inactive_internal(); + if (m_ses.settings().get_bool(settings_pack::dont_count_slow_torrents)) + m_ses.trigger_auto_manage(); + } + void torrent::maybe_connect_web_seeds() { if (m_abort) return;