#include <policy.hpp>
Definition at line 77 of file policy.hpp.
| typedef std::vector<peer>::iterator libtorrent::policy::iterator |
Definition at line 185 of file policy.hpp.
| libtorrent::policy::policy | ( | torrent * | t | ) |
Definition at line 347 of file policy.cpp.
| void libtorrent::policy::pulse | ( | ) |
Definition at line 617 of file policy.cpp.
References libtorrent::torrent::begin(), c, check_invariant(), choke_one_peer(), collect_free_download(), connect_one_peer(), libtorrent::policy::peer::connection, disconnect_one_peer(), distribute_free_upload(), libtorrent::torrent::end(), find_choke_candidate(), find_seed_choke_candidate(), find_seed_unchoke_candidate(), find_unchoke_candidate(), libtorrent::free_upload_amount, libtorrent::resource_request::given, INVARIANT_CHECK, libtorrent::peer_connection::is_choked(), libtorrent::torrent::is_paused(), libtorrent::torrent::is_seed(), asio::placeholders::iterator, m_available_free_upload, libtorrent::torrent::m_connections_quota, m_last_optimistic_disconnect, m_num_unchoked, m_peers, m_torrent, libtorrent::torrent::m_uploads_quota, num_peers(), libtorrent::torrent::num_peers(), libtorrent::torrent::ratio(), seed_choke_one_peer(), seed_unchoke_one_peer(), libtorrent::peer_connection::send_choke(), libtorrent::peer_connection::send_unchoke(), and unchoke_one_peer().
| void libtorrent::policy::peer_from_tracker | ( | const tcp::endpoint & | remote, | |
| const peer_id & | pid | |||
| ) |
Definition at line 948 of file policy.cpp.
References asio::ip::basic_endpoint< InternetProtocol >::address(), libtorrent::torrent::alerts(), libtorrent::session_settings::allow_multiple_connections_per_ip, connect_peer(), libtorrent::policy::peer::connectable, libtorrent::alert::debug, simple_client::e, libtorrent::resource_request::given, INVARIANT_CHECK, libtorrent::torrent::is_paused(), asio::placeholders::iterator, libtorrent::torrent::m_connections_quota, m_peers, m_torrent, libtorrent::torrent::num_peers(), asio::ip::basic_endpoint< InternetProtocol >::port(), libtorrent::alert_manager::post_alert(), libtorrent::torrent::settings(), libtorrent::alert_manager::should_post(), and asio::ip::address::to_string().
Referenced by libtorrent::torrent::on_dht_announce_response().
| void libtorrent::policy::new_connection | ( | peer_connection & | c | ) |
Definition at line 855 of file policy.cpp.
References libtorrent::peer_connection::add_stat(), asio::ip::basic_endpoint< InternetProtocol >::address(), libtorrent::session_settings::allow_multiple_connections_per_ip, libtorrent::torrent::current_tracker(), libtorrent::peer_connection::get_socket(), libtorrent::resource_request::given, INVARIANT_CHECK, libtorrent::peer_connection::is_local(), asio::placeholders::iterator, libtorrent::torrent::m_connections_quota, m_last_optimistic_disconnect, m_peers, m_torrent, libtorrent::policy::peer::not_connectable, libtorrent::torrent::num_peers(), libtorrent::peer_connection::proxy(), libtorrent::peer_connection::remote(), and libtorrent::torrent::settings().
| void libtorrent::policy::peer_failed | ( | peer_connection const & | c | ) |
| void libtorrent::policy::connection_closed | ( | const peer_connection & | c | ) |
Definition at line 1238 of file policy.cpp.
References libtorrent::peer_connection::failed(), INVARIANT_CHECK, libtorrent::torrent::is_aborted(), libtorrent::torrent::is_seed(), asio::placeholders::iterator, m_available_free_upload, m_num_unchoked, m_peers, m_torrent, libtorrent::policy::peer::not_connectable, libtorrent::torrent::ratio(), seed_unchoke_one_peer(), libtorrent::peer_connection::statistics(), libtorrent::stat::total_payload_download(), libtorrent::stat::total_payload_upload(), unchoke_one_peer(), and unchoked().
| void libtorrent::policy::ban_peer | ( | const peer_connection & | c | ) |
Definition at line 831 of file policy.cpp.
References INVARIANT_CHECK, asio::placeholders::iterator, m_peers, m_torrent, libtorrent::policy::peer::not_connectable, and libtorrent::torrent::remove_url_seed().
| void libtorrent::policy::peer_is_interesting | ( | peer_connection & | c | ) |
Definition at line 1296 of file policy.cpp.
References libtorrent::peer_connection::has_peer_choked(), INVARIANT_CHECK, m_torrent, libtorrent::request_a_block(), and libtorrent::peer_connection::send_interested().
| void libtorrent::policy::piece_finished | ( | int | index, | |
| bool | successfully_verified | |||
| ) |
Definition at line 1047 of file policy.cpp.
References interested(), INVARIANT_CHECK, asio::placeholders::iterator, m_peers, m_torrent, and libtorrent::torrent::pieces().
Referenced by libtorrent::peer_connection::incoming_piece().
| void libtorrent::policy::block_finished | ( | peer_connection & | c, | |
| piece_block | b | |||
| ) |
Definition at line 1086 of file policy.cpp.
References libtorrent::peer_connection::has_peer_choked(), INVARIANT_CHECK, libtorrent::torrent::is_seed(), m_torrent, and libtorrent::request_a_block().
Referenced by libtorrent::peer_connection::incoming_piece().
| void libtorrent::policy::choked | ( | peer_connection & | c | ) |
Definition at line 1043 of file policy.cpp.
| void libtorrent::policy::unchoked | ( | peer_connection & | c | ) |
Definition at line 1098 of file policy.cpp.
References INVARIANT_CHECK, libtorrent::peer_connection::is_interesting(), m_torrent, and libtorrent::request_a_block().
Referenced by connection_closed().
| void libtorrent::policy::interested | ( | peer_connection & | c | ) |
Definition at line 1108 of file policy.cpp.
References asio::detail::socket_ops::bind(), libtorrent::policy::peer::connection, libtorrent::free_upload_amount, libtorrent::resource_request::given, INVARIANT_CHECK, libtorrent::peer_connection::is_choked(), libtorrent::torrent::is_seed(), m_num_unchoked, m_peers, m_torrent, libtorrent::torrent::m_uploads_quota, libtorrent::torrent::ratio(), libtorrent::peer_connection::send_unchoke(), and libtorrent::peer_connection::share_diff().
Referenced by piece_finished().
| void libtorrent::policy::not_interested | ( | peer_connection & | c | ) |
Definition at line 1138 of file policy.cpp.
References libtorrent::peer_connection::add_free_upload(), INVARIANT_CHECK, libtorrent::peer_connection::is_choked(), libtorrent::torrent::is_seed(), libtorrent::peer_connection::is_seed(), m_available_free_upload, m_num_unchoked, m_torrent, libtorrent::torrent::ratio(), seed_unchoke_one_peer(), libtorrent::peer_connection::send_choke(), libtorrent::peer_connection::share_diff(), and unchoke_one_peer().
| bool libtorrent::policy::has_connection | ( | const peer_connection * | p | ) |
Definition at line 1306 of file policy.cpp.
References libtorrent::peer_connection::get_socket(), m_peers, libtorrent::peer_connection::proxy(), and libtorrent::peer_connection::remote().
| void libtorrent::policy::check_invariant | ( | ) | const |
Definition at line 1318 of file policy.cpp.
References libtorrent::torrent::begin(), libtorrent::torrent::end(), libtorrent::torrent::is_aborted(), m_num_unchoked, m_peers, and m_torrent.
Referenced by pulse().
| int libtorrent::policy::num_peers | ( | ) | const [inline] |
| int libtorrent::policy::num_uploads | ( | ) | const [inline] |
Definition at line 180 of file policy.hpp.
| iterator libtorrent::policy::begin_peer | ( | ) | [inline] |
Definition at line 186 of file policy.hpp.
Referenced by libtorrent::bt_peer_connection::on_receive(), and libtorrent::torrent_handle::write_resume_data().
| iterator libtorrent::policy::end_peer | ( | ) | [inline] |
Definition at line 187 of file policy.hpp.
Referenced by libtorrent::bt_peer_connection::on_receive(), and libtorrent::torrent_handle::write_resume_data().
| bool libtorrent::policy::unchoke_one_peer | ( | ) | [private] |
Definition at line 1165 of file policy.cpp.
References libtorrent::policy::peer::connection, find_unchoke_candidate(), libtorrent::peer_connection::is_choked(), libtorrent::peer_connection::is_disconnecting(), libtorrent::policy::peer::last_optimistically_unchoked, m_num_unchoked, and libtorrent::peer_connection::send_unchoke().
Referenced by connection_closed(), not_interested(), and pulse().
| void libtorrent::policy::choke_one_peer | ( | ) | [private] |
Definition at line 1179 of file policy.cpp.
References libtorrent::policy::peer::connection, find_choke_candidate(), libtorrent::peer_connection::is_choked(), libtorrent::peer_connection::is_disconnecting(), m_num_unchoked, and libtorrent::peer_connection::send_choke().
Referenced by pulse().
| policy::peer * libtorrent::policy::find_choke_candidate | ( | ) | [private] |
Definition at line 356 of file policy.cpp.
References c, libtorrent::stat::download_rate(), libtorrent::peer_connection::has_peer_choked(), INVARIANT_CHECK, libtorrent::peer_connection::is_choked(), libtorrent::peer_connection::is_disconnecting(), libtorrent::peer_connection::is_interesting(), libtorrent::peer_connection::is_peer_interested(), asio::placeholders::iterator, m_num_unchoked, m_peers, and libtorrent::peer_connection::statistics().
Referenced by choke_one_peer(), and pulse().
| policy::peer * libtorrent::policy::find_unchoke_candidate | ( | ) | [private] |
Definition at line 401 of file policy.cpp.
References c, libtorrent::stat::download_rate(), libtorrent::free_upload_amount, INVARIANT_CHECK, libtorrent::peer_connection::is_choked(), libtorrent::peer_connection::is_disconnecting(), libtorrent::peer_connection::is_peer_interested(), asio::placeholders::iterator, m_num_unchoked, m_peers, m_torrent, libtorrent::torrent::num_peers(), libtorrent::torrent::ratio(), libtorrent::peer_connection::share_diff(), and libtorrent::peer_connection::statistics().
Referenced by pulse(), and unchoke_one_peer().
| bool libtorrent::policy::seed_unchoke_one_peer | ( | ) | [private] |
Definition at line 588 of file policy.cpp.
References libtorrent::policy::peer::connection, find_seed_unchoke_candidate(), INVARIANT_CHECK, libtorrent::peer_connection::is_choked(), libtorrent::policy::peer::last_optimistically_unchoked, m_num_unchoked, and libtorrent::peer_connection::send_unchoke().
Referenced by connection_closed(), not_interested(), and pulse().
| void libtorrent::policy::seed_choke_one_peer | ( | ) | [private] |
Definition at line 604 of file policy.cpp.
References libtorrent::policy::peer::connection, find_seed_choke_candidate(), INVARIANT_CHECK, libtorrent::peer_connection::is_choked(), m_num_unchoked, and libtorrent::peer_connection::send_choke().
Referenced by pulse().
| policy::peer * libtorrent::policy::find_seed_choke_candidate | ( | ) | [private] |
Definition at line 507 of file policy.cpp.
References c, INVARIANT_CHECK, libtorrent::peer_connection::is_choked(), libtorrent::peer_connection::is_disconnecting(), asio::placeholders::iterator, libtorrent::policy::peer::last_optimistically_unchoked, m_num_unchoked, m_peers, and libtorrent::peer_connection::share_diff().
Referenced by pulse(), and seed_choke_one_peer().
| policy::peer * libtorrent::policy::find_seed_unchoke_candidate | ( | ) | [private] |
Definition at line 565 of file policy.cpp.
References c, INVARIANT_CHECK, libtorrent::peer_connection::is_choked(), libtorrent::peer_connection::is_disconnecting(), libtorrent::peer_connection::is_peer_interested(), asio::placeholders::iterator, and m_peers.
Referenced by pulse(), and seed_unchoke_one_peer().
Definition at line 1203 of file policy.cpp.
References libtorrent::peer_connection::add_stat(), libtorrent::torrent::connect_to_peer(), libtorrent::policy::peer::connected, libtorrent::policy::peer::connection, simple_client::e, INVARIANT_CHECK, libtorrent::policy::peer::ip, m_last_optimistic_disconnect, m_torrent, libtorrent::policy::peer::prev_amount_download, and libtorrent::policy::peer::prev_amount_upload.
Referenced by connect_one_peer(), and peer_from_tracker().
| bool libtorrent::policy::connect_one_peer | ( | ) | [private] |
Definition at line 1190 of file policy.cpp.
References libtorrent::policy::peer::banned, connect_peer(), libtorrent::policy::peer::connectable, libtorrent::policy::peer::connection, find_connect_candidate(), libtorrent::resource_request::given, libtorrent::torrent::m_connections_quota, m_torrent, libtorrent::torrent::num_peers(), and libtorrent::policy::peer::type.
Referenced by pulse().
| bool libtorrent::policy::disconnect_one_peer | ( | ) | [private] |
Definition at line 1224 of file policy.cpp.
References libtorrent::policy::peer::connection, libtorrent::peer_connection::disconnect(), and find_disconnect_candidate().
Referenced by pulse().
| policy::peer * libtorrent::policy::find_disconnect_candidate | ( | ) | [private] |
Definition at line 438 of file policy.cpp.
References c, libtorrent::peer_connection::is_disconnecting(), asio::placeholders::iterator, m_peers, libtorrent::peer_connection::statistics(), and libtorrent::stat::total_payload_download().
Referenced by disconnect_one_peer().
| policy::peer * libtorrent::policy::find_connect_candidate | ( | ) | [private] |
Definition at line 478 of file policy.cpp.
References asio::placeholders::iterator, m_peers, and libtorrent::policy::peer::not_connectable.
Referenced by connect_one_peer().
std::vector<peer> libtorrent::policy::m_peers [private] |
Definition at line 227 of file policy.hpp.
Referenced by ban_peer(), check_invariant(), connection_closed(), find_choke_candidate(), find_connect_candidate(), find_disconnect_candidate(), find_seed_choke_candidate(), find_seed_unchoke_candidate(), find_unchoke_candidate(), has_connection(), interested(), new_connection(), peer_from_tracker(), piece_finished(), and pulse().
torrent* libtorrent::policy::m_torrent [private] |
Definition at line 229 of file policy.hpp.
Referenced by ban_peer(), block_finished(), check_invariant(), connect_one_peer(), connect_peer(), connection_closed(), find_unchoke_candidate(), interested(), new_connection(), not_interested(), peer_from_tracker(), peer_is_interesting(), piece_finished(), pulse(), and unchoked().
int libtorrent::policy::m_num_unchoked [private] |
Definition at line 233 of file policy.hpp.
Referenced by check_invariant(), choke_one_peer(), connection_closed(), find_choke_candidate(), find_seed_choke_candidate(), find_unchoke_candidate(), interested(), not_interested(), pulse(), seed_choke_one_peer(), seed_unchoke_one_peer(), and unchoke_one_peer().
Definition at line 237 of file policy.hpp.
Referenced by connection_closed(), not_interested(), and pulse().
boost::posix_time::ptime libtorrent::policy::m_last_optimistic_disconnect [private] |
Definition at line 242 of file policy.hpp.
Referenced by connect_peer(), new_connection(), and pulse().
1.5.6