│ │ │
│ │ │ +
│ │ │ +
peer_connection_handle
│ │ │ +
Declared in "libtorrent/peer_connection_handle.hpp"
│ │ │ +
the peer_connection_handle class provides a handle to the internal peer
│ │ │ +connection object, to be used by plugins. This is a low level interface that
│ │ │ +may not be stable across libtorrent versions
│ │ │ +
│ │ │ +struct peer_connection_handle
│ │ │ +{
│ │ │ + explicit peer_connection_handle (std::weak_ptr<peer_connection> impl);
│ │ │ + connection_type type () const;
│ │ │ + peer_plugin const* find_plugin (string_view type) const;
│ │ │ + void add_extension (std::shared_ptr<peer_plugin>);
│ │ │ + bool is_seed () const;
│ │ │ + bool upload_only () const;
│ │ │ + peer_id const& pid () const;
│ │ │ + bool has_piece (piece_index_t i) const;
│ │ │ + bool is_choked () const;
│ │ │ + bool is_interesting () const;
│ │ │ + bool is_peer_interested () const;
│ │ │ + bool has_peer_choked () const;
│ │ │ + void choke_this_peer ();
│ │ │ + void maybe_unchoke_this_peer ();
│ │ │ + void get_peer_info (peer_info& p) const;
│ │ │ + torrent_handle associated_torrent () const;
│ │ │ + tcp::endpoint local_endpoint () const;
│ │ │ + tcp::endpoint const& remote () const;
│ │ │ + bool is_outgoing () const;
│ │ │ + bool is_connecting () const;
│ │ │ + bool is_disconnecting () const;
│ │ │ + void disconnect (error_code const& ec, operation_t op
│ │ │ + , disconnect_severity_t = peer_connection_interface::normal);
│ │ │ + bool on_local_network () const;
│ │ │ + bool ignore_unchoke_slots () const;
│ │ │ + bool failed () const;
│ │ │ + bool should_log (peer_log_alert::direction_t direction) const;
│ │ │ + void peer_log (peer_log_alert::direction_t direction
│ │ │ + , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);
│ │ │ + bool can_disconnect (error_code const& ec) const;
│ │ │ + bool has_metadata () const;
│ │ │ + bool in_handshake () const;
│ │ │ + void send_buffer (char const* begin, int size);
│ │ │ + std::time_t last_seen_complete () const;
│ │ │ + time_point time_of_last_unchoke () const;
│ │ │ + bool operator< (peer_connection_handle const& o) const;
│ │ │ + bool operator== (peer_connection_handle const& o) const;
│ │ │ + bool operator!= (peer_connection_handle const& o) const;
│ │ │ + std::shared_ptr<peer_connection> native_handle () const;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
bt_peer_connection_handle
│ │ │ +
Declared in "libtorrent/peer_connection_handle.hpp"
│ │ │ +
The bt_peer_connection_handle provides a handle to the internal bittorrent
│ │ │ +peer connection object to plugins. It's low level and may not be a stable API
│ │ │ +across libtorrent versions.
│ │ │ +
│ │ │ +struct bt_peer_connection_handle : peer_connection_handle
│ │ │ +{
│ │ │ + explicit bt_peer_connection_handle (peer_connection_handle pc);
│ │ │ + bool packet_finished () const;
│ │ │ + bool support_extensions () const;
│ │ │ + bool supports_encryption () const;
│ │ │ + void switch_send_crypto (std::shared_ptr<crypto_plugin> crypto);
│ │ │ + void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);
│ │ │ + std::shared_ptr<bt_peer_connection> native_handle () const;
│ │ │ +};
│ │ │ +
│ │ │
[report issue]
│ │ │
│ │ │
plugin
│ │ │
Declared in "libtorrent/extensions.hpp"
│ │ │
this is the base class for a session plugin. One primary feature
│ │ │ is that it is notified of all torrents that are added to the session,
│ │ │ and can add its own torrent_plugins.
│ │ │ @@ -345,16 +415,16 @@
│ │ │
Torrent plugins are associated with a single torrent and have a number
│ │ │ of functions called at certain events. Many of its functions have the
│ │ │ ability to change or override the default libtorrent behavior.
│ │ │
│ │ │ struct torrent_plugin
│ │ │ {
│ │ │ virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);
│ │ │ - virtual void on_piece_failed (piece_index_t);
│ │ │ virtual void on_piece_pass (piece_index_t);
│ │ │ + virtual void on_piece_failed (piece_index_t);
│ │ │ virtual void tick ();
│ │ │ virtual bool on_resume ();
│ │ │ virtual bool on_pause ();
│ │ │ virtual void on_files_checked ();
│ │ │ virtual void on_state (torrent_status::state_t);
│ │ │ virtual void on_add_peer (tcp::endpoint const&,
│ │ │ peer_source_flags_t, add_peer_flags_t);
│ │ │ @@ -381,16 +451,16 @@
│ │ │ to it, use weak_ptr.
│ │ │ If this function throws an exception, the connection will be closed.
│ │ │
│ │ │ [report issue]
│ │ │
│ │ │
on_piece_pass() on_piece_failed()
│ │ │
│ │ │ -virtual void on_piece_failed (piece_index_t);
│ │ │ virtual void on_piece_pass (piece_index_t);
│ │ │ +virtual void on_piece_failed (piece_index_t);
│ │ │
│ │ │
These hooks are called when a piece passes the hash check or fails the hash
│ │ │ check, respectively. The index is the piece index that was downloaded.
│ │ │ It is possible to access the list of peers that participated in sending the
│ │ │ piece through the torrent and the piece_picker.
│ │ │
[report issue]
│ │ │
│ │ │ @@ -475,51 +545,51 @@
│ │ │ {
│ │ │ virtual string_view
type () const;
│ │ │ virtual void
add_handshake (entry&);
│ │ │ virtual void
on_disconnect (error_code const&);
│ │ │ virtual void
on_connected ();
│ │ │ virtual bool
on_handshake (span<char const>);
│ │ │ virtual bool
on_extension_handshake (bdecode_node const&);
│ │ │ - virtual bool
on_have_none ();
│ │ │ + virtual bool
on_have_all ();
│ │ │ + virtual bool
on_dont_have (piece_index_t);
│ │ │ + virtual bool
on_choke ();
│ │ │ virtual bool
on_have (piece_index_t);
│ │ │ - virtual bool
on_request (peer_request const&);
│ │ │ - virtual bool
on_not_interested ();
│ │ │ - virtual bool
on_allowed_fast (piece_index_t);
│ │ │ - virtual bool
on_bitfield (bitfield const&
/*bitfield*/);
│ │ │ virtual bool
on_interested ();
│ │ │ - virtual bool
on_choke ();
│ │ │ + virtual bool
on_allowed_fast (piece_index_t);
│ │ │ + virtual bool
on_have_none ();
│ │ │ + virtual bool
on_request (peer_request const&);
│ │ │ virtual bool
on_unchoke ();
│ │ │ - virtual bool
on_have_all ();
│ │ │ - virtual bool
on_dont_have (piece_index_t);
│ │ │ + virtual bool
on_bitfield (bitfield const&
/*bitfield*/);
│ │ │ + virtual bool
on_not_interested ();
│ │ │ virtual bool
on_piece (peer_request const&
/*piece*/
│ │ │ , span<char const>
/*buf*/);
│ │ │ - virtual bool
on_reject (peer_request const&);
│ │ │ virtual bool
on_suggest (piece_index_t);
│ │ │ virtual bool
on_cancel (peer_request const&);
│ │ │ - virtual void
sent_allow_fast (piece_index_t);
│ │ │ - virtual void
sent_choke ();
│ │ │ + virtual bool
on_reject (peer_request const&);
│ │ │ virtual void
sent_have_all ();
│ │ │ virtual void
sent_suggest (piece_index_t);
│ │ │ - virtual void
sent_request (peer_request const&);
│ │ │ - virtual void
sent_have_none ();
│ │ │ virtual void
sent_reject_request (peer_request const&);
│ │ │ + virtual void
sent_have_none ();
│ │ │ virtual void
sent_cancel (peer_request const&);
│ │ │ + virtual void
sent_allow_fast (piece_index_t);
│ │ │ + virtual void
sent_request (peer_request const&);
│ │ │ + virtual void
sent_choke ();
│ │ │ virtual void
sent_have (piece_index_t);
│ │ │ + virtual void
sent_unchoke ();
│ │ │ virtual void
sent_interested ();
│ │ │ - virtual void
sent_piece (peer_request const&);
│ │ │ virtual void
sent_not_interested ();
│ │ │ - virtual void
sent_unchoke ();
│ │ │ + virtual void
sent_piece (peer_request const&);
│ │ │ virtual void
sent_payload (int
/* bytes */);
│ │ │ virtual bool
can_disconnect (error_code const&
/*ec*/);
│ │ │ virtual bool
on_extended (int
/*length*/, int
/*msg*/,
│ │ │ span<char const>
/*body*/);
│ │ │ virtual bool
on_unknown_message (int
/*length*/, int
/*msg*/,
│ │ │ span<char const>
/*body*/);
│ │ │ - virtual void
on_piece_failed (piece_index_t);
│ │ │ virtual void
on_piece_pass (piece_index_t);
│ │ │ + virtual void
on_piece_failed (piece_index_t);
│ │ │ virtual void
tick ();
│ │ │ virtual bool
write_request (peer_request const&);
│ │ │ };
│ │ │
│ │ │
[report issue]
│ │ │
type()
│ │ │
│ │ │ @@ -569,39 +639,39 @@
│ │ │ virtual bool on_extension_handshake (bdecode_node const&);
│ │ │
│ │ │
called when the extension handshake from the other end is received
│ │ │ if this returns false, it means that this extension isn't
│ │ │ supported by this peer. It will result in this peer_plugin
│ │ │ being removed from the peer_connection and destructed.
│ │ │ this is not called for web seeds
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │
│ │ │ +
│ │ │ +
│ │ │
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_unchoke() on_have_none() on_not_interested() on_request() on_dont_have() on_have_all() on_bitfield() on_have() on_allowed_fast() on_choke() on_interested()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_have() on_interested() on_bitfield() on_allowed_fast() on_request() on_dont_have() on_have_none() on_unchoke() on_choke() on_have_all() on_not_interested()
│ │ │
│ │ │ -virtual bool on_have_none ();
│ │ │ +virtual bool on_have_all ();
│ │ │ +virtual bool on_dont_have (piece_index_t);
│ │ │ +virtual bool on_choke ();
│ │ │ virtual bool on_have (piece_index_t);
│ │ │ -virtual bool on_request (peer_request const&);
│ │ │ -virtual bool on_not_interested ();
│ │ │ -virtual bool on_allowed_fast (piece_index_t);
│ │ │ -virtual bool on_bitfield (bitfield const& /*bitfield*/);
│ │ │ virtual bool on_interested ();
│ │ │ -virtual bool on_choke ();
│ │ │ +virtual bool on_allowed_fast (piece_index_t);
│ │ │ +virtual bool on_have_none ();
│ │ │ +virtual bool on_request (peer_request const&);
│ │ │ virtual bool on_unchoke ();
│ │ │ -virtual bool on_have_all ();
│ │ │ -virtual bool on_dont_have (piece_index_t);
│ │ │ +virtual bool on_bitfield (bitfield const& /*bitfield*/);
│ │ │ +virtual bool on_not_interested ();
│ │ │
│ │ │
returning true from any of the message handlers
│ │ │ indicates that the plugin has handled the message.
│ │ │ it will break the plugin chain traversing and not let
│ │ │ anyone else handle the message, including the default
│ │ │ handler.
│ │ │
[report issue]
│ │ │ @@ -613,27 +683,27 @@
│ │ │
│ │ │
This function is called when the peer connection is receiving
│ │ │ a piece. buf points (non-owning pointer) to the data in an
│ │ │ internal immutable disk buffer. The length of the data is specified
│ │ │ in the length member of the piece parameter.
│ │ │ returns true to indicate that the piece is handled and the
│ │ │ rest of the logic should be ignored.
│ │ │ +
│ │ │
│ │ │ -
│ │ │
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
sent_unchoke() sent_have() sent_not_interested() sent_piece() sent_interested()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
sent_piece() sent_unchoke() sent_not_interested() sent_have() sent_interested()
│ │ │
│ │ │ virtual void sent_have (piece_index_t);
│ │ │ +virtual void sent_unchoke ();
│ │ │ virtual void sent_interested ();
│ │ │ -virtual void sent_piece (peer_request const&);
│ │ │ virtual void sent_not_interested ();
│ │ │ -virtual void sent_unchoke ();
│ │ │ +virtual void sent_piece (peer_request const&);
│ │ │
│ │ │
called after a choke message has been sent to the peer
│ │ │
[report issue]
│ │ │
│ │ │
sent_payload()
│ │ │
│ │ │ virtual void sent_payload (int /* bytes */);
│ │ │ @@ -674,16 +744,16 @@
│ │ │
│ │ │
this is not called for web seeds
│ │ │
│ │ │
[report issue]
│ │ │
│ │ │
on_piece_pass() on_piece_failed()
│ │ │
│ │ │ -virtual void on_piece_failed (piece_index_t);
│ │ │ virtual void on_piece_pass (piece_index_t);
│ │ │ +virtual void on_piece_failed (piece_index_t);
│ │ │
│ │ │
called when a piece that this peer participated in either
│ │ │ fails or passes the hash_check
│ │ │
[report issue]
│ │ │
│ │ │
tick()
│ │ │
│ │ │ @@ -703,16 +773,16 @@
│ │ │
│ │ │
│ │ │
crypto_plugin
│ │ │
Declared in "libtorrent/extensions.hpp"
│ │ │
│ │ │ struct crypto_plugin
│ │ │ {
│ │ │ - virtual void set_incoming_key (span<char const> key) = 0;
│ │ │ virtual void set_outgoing_key (span<char const> key) = 0;
│ │ │ + virtual void set_incoming_key (span<char const> key) = 0;
│ │ │ encrypt (span<span<char>> /*send_vec*/) = 0;
│ │ │ virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;
│ │ │ };
│ │ │
│ │ │
[report issue]
│ │ │
decrypt()
│ │ │
│ │ │ @@ -723,86 +793,16 @@
│ │ │ (consume, produce, packet_size)
│ │ │ consume is set to the number of bytes which should be trimmed from the
│ │ │ head of the buffers, default is 0
│ │ │ produce is set to the number of bytes of payload which are now ready to
│ │ │ be sent to the upper layer. default is the number of bytes passed in receive_vec
│ │ │ packet_size is set to the minimum number of bytes which must be read to
│ │ │ advance the next step of decryption. default is 0
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
peer_connection_handle
│ │ │ -
Declared in "libtorrent/peer_connection_handle.hpp"
│ │ │ -
the peer_connection_handle class provides a handle to the internal peer
│ │ │ -connection object, to be used by plugins. This is a low level interface that
│ │ │ -may not be stable across libtorrent versions
│ │ │ -
│ │ │ -struct peer_connection_handle
│ │ │ -{
│ │ │ - explicit peer_connection_handle (std::weak_ptr<peer_connection> impl);
│ │ │ - connection_type type () const;
│ │ │ - peer_plugin const* find_plugin (string_view type) const;
│ │ │ - void add_extension (std::shared_ptr<peer_plugin>);
│ │ │ - bool is_seed () const;
│ │ │ - bool upload_only () const;
│ │ │ - peer_id const& pid () const;
│ │ │ - bool has_piece (piece_index_t i) const;
│ │ │ - bool is_interesting () const;
│ │ │ - bool is_choked () const;
│ │ │ - bool is_peer_interested () const;
│ │ │ - bool has_peer_choked () const;
│ │ │ - void choke_this_peer ();
│ │ │ - void maybe_unchoke_this_peer ();
│ │ │ - void get_peer_info (peer_info& p) const;
│ │ │ - torrent_handle associated_torrent () const;
│ │ │ - tcp::endpoint const& remote () const;
│ │ │ - tcp::endpoint local_endpoint () const;
│ │ │ - void disconnect (error_code const& ec, operation_t op
│ │ │ - , disconnect_severity_t = peer_connection_interface::normal);
│ │ │ - bool is_outgoing () const;
│ │ │ - bool is_connecting () const;
│ │ │ - bool is_disconnecting () const;
│ │ │ - bool on_local_network () const;
│ │ │ - bool ignore_unchoke_slots () const;
│ │ │ - bool failed () const;
│ │ │ - bool should_log (peer_log_alert::direction_t direction) const;
│ │ │ - void peer_log (peer_log_alert::direction_t direction
│ │ │ - , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);
│ │ │ - bool can_disconnect (error_code const& ec) const;
│ │ │ - bool has_metadata () const;
│ │ │ - bool in_handshake () const;
│ │ │ - void send_buffer (char const* begin, int size);
│ │ │ - std::time_t last_seen_complete () const;
│ │ │ - time_point time_of_last_unchoke () const;
│ │ │ - bool operator== (peer_connection_handle const& o) const;
│ │ │ - bool operator< (peer_connection_handle const& o) const;
│ │ │ - bool operator!= (peer_connection_handle const& o) const;
│ │ │ - std::shared_ptr<peer_connection> native_handle () const;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
bt_peer_connection_handle
│ │ │ -
Declared in "libtorrent/peer_connection_handle.hpp"
│ │ │ -
The bt_peer_connection_handle provides a handle to the internal bittorrent
│ │ │ -peer connection object to plugins. It's low level and may not be a stable API
│ │ │ -across libtorrent versions.
│ │ │ -
│ │ │ -struct bt_peer_connection_handle : peer_connection_handle
│ │ │ -{
│ │ │ - explicit bt_peer_connection_handle (peer_connection_handle pc);
│ │ │ - bool packet_finished () const;
│ │ │ - bool support_extensions () const;
│ │ │ - bool supports_encryption () const;
│ │ │ - void switch_send_crypto (std::shared_ptr<crypto_plugin> crypto);
│ │ │ - void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);
│ │ │ - std::shared_ptr<bt_peer_connection> native_handle () const;
│ │ │ -};
│ │ │ -
│ │ │
[report issue]
│ │ │ +
│ │ │
create_ut_pex_plugin()
│ │ │
Declared in "libtorrent/extensions/ut_pex.hpp"
│ │ │
│ │ │ std::shared_ptr<torrent_plugin> create_ut_pex_plugin (torrent_handle const&, client_data_t);
│ │ │
│ │ │
constructor function for the ut_pex extension. The ut_pex
│ │ │ ├── html2text {}
│ │ │ │ @@ -2,14 +2,16 @@
│ │ │ │ _[_l_i_b_t_o_r_r_e_n_t_ _l_o_g_o_]
│ │ │ │ VVeerrssiioonn:: 2.0.11
│ │ │ │ _h_o_m_e
│ │ │ │ Table of contents
│ │ │ │ * _a_ _w_o_r_d_ _o_f_ _c_a_u_t_i_o_n
│ │ │ │ * _p_l_u_g_i_n_-_i_n_t_e_r_f_a_c_e
│ │ │ │ * _c_u_s_t_o_m_ _a_l_e_r_t_s
│ │ │ │ + * _p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e
│ │ │ │ + * _b_t___p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e
│ │ │ │ * _p_l_u_g_i_n
│ │ │ │ o _i_m_p_l_e_m_e_n_t_e_d___f_e_a_t_u_r_e_s_(_)
│ │ │ │ o _n_e_w___t_o_r_r_e_n_t_(_)
│ │ │ │ o _a_d_d_e_d_(_)
│ │ │ │ o _a_b_o_r_t_(_)
│ │ │ │ o _o_n___d_h_t___r_e_q_u_e_s_t_(_)
│ │ │ │ o _o_n___a_l_e_r_t_(_)
│ │ │ │ @@ -28,31 +30,29 @@
│ │ │ │ * _p_e_e_r___p_l_u_g_i_n
│ │ │ │ o _t_y_p_e_(_)
│ │ │ │ o _a_d_d___h_a_n_d_s_h_a_k_e_(_)
│ │ │ │ o _o_n___d_i_s_c_o_n_n_e_c_t_(_)
│ │ │ │ o _o_n___c_o_n_n_e_c_t_e_d_(_)
│ │ │ │ o _o_n___h_a_n_d_s_h_a_k_e_(_)
│ │ │ │ o _o_n___e_x_t_e_n_s_i_o_n___h_a_n_d_s_h_a_k_e_(_)
│ │ │ │ - o _o_n___u_n_c_h_o_k_e_(_)_ _o_n___h_a_v_e___n_o_n_e_(_)_ _o_n___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)_ _o_n___r_e_q_u_e_s_t_(_)
│ │ │ │ - _o_n___d_o_n_t___h_a_v_e_(_)_ _o_n___h_a_v_e___a_l_l_(_)_ _o_n___b_i_t_f_i_e_l_d_(_)_ _o_n___h_a_v_e_(_)
│ │ │ │ - _o_n___a_l_l_o_w_e_d___f_a_s_t_(_)_ _o_n___c_h_o_k_e_(_)_ _o_n___i_n_t_e_r_e_s_t_e_d_(_)
│ │ │ │ + o _o_n___h_a_v_e_(_)_ _o_n___i_n_t_e_r_e_s_t_e_d_(_)_ _o_n___b_i_t_f_i_e_l_d_(_)_ _o_n___a_l_l_o_w_e_d___f_a_s_t_(_)
│ │ │ │ + _o_n___r_e_q_u_e_s_t_(_)_ _o_n___d_o_n_t___h_a_v_e_(_)_ _o_n___h_a_v_e___n_o_n_e_(_)_ _o_n___u_n_c_h_o_k_e_(_)_ _o_n___c_h_o_k_e_(_)
│ │ │ │ + _o_n___h_a_v_e___a_l_l_(_)_ _o_n___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)
│ │ │ │ o _o_n___p_i_e_c_e_(_)
│ │ │ │ - o _s_e_n_t___u_n_c_h_o_k_e_(_)_ _s_e_n_t___h_a_v_e_(_)_ _s_e_n_t___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)_ _s_e_n_t___p_i_e_c_e_(_)
│ │ │ │ + o _s_e_n_t___p_i_e_c_e_(_)_ _s_e_n_t___u_n_c_h_o_k_e_(_)_ _s_e_n_t___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)_ _s_e_n_t___h_a_v_e_(_)
│ │ │ │ _s_e_n_t___i_n_t_e_r_e_s_t_e_d_(_)
│ │ │ │ o _s_e_n_t___p_a_y_l_o_a_d_(_)
│ │ │ │ o _c_a_n___d_i_s_c_o_n_n_e_c_t_(_)
│ │ │ │ o _o_n___e_x_t_e_n_d_e_d_(_)
│ │ │ │ o _o_n___u_n_k_n_o_w_n___m_e_s_s_a_g_e_(_)
│ │ │ │ o _o_n___p_i_e_c_e___p_a_s_s_(_)_ _o_n___p_i_e_c_e___f_a_i_l_e_d_(_)
│ │ │ │ o _t_i_c_k_(_)
│ │ │ │ o _w_r_i_t_e___r_e_q_u_e_s_t_(_)
│ │ │ │ * _c_r_y_p_t_o___p_l_u_g_i_n
│ │ │ │ o _d_e_c_r_y_p_t_(_)
│ │ │ │ - * _p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e
│ │ │ │ - * _b_t___p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e
│ │ │ │ * _c_r_e_a_t_e___u_t___p_e_x___p_l_u_g_i_n_(_)
│ │ │ │ * _c_r_e_a_t_e___s_m_a_r_t___b_a_n___p_l_u_g_i_n_(_)
│ │ │ │ * _c_r_e_a_t_e___u_t___m_e_t_a_d_a_t_a___p_l_u_g_i_n_(_)
│ │ │ │ libtorrent has a _p_l_u_g_i_n interface for implementing extensions to the protocol.
│ │ │ │ These can be general extensions for transferring metadata or peer exchange
│ │ │ │ extensions, or it could be used to provide a way to customize the protocol to
│ │ │ │ fit a particular (closed) network.
│ │ │ │ @@ -131,14 +131,79 @@
│ │ │ │ The static category is required for checking whether or not the category for a
│ │ │ │ specific _a_l_e_r_t is enabled or not, without instantiating the _a_l_e_r_t. The category
│ │ │ │ virtual function is the run-time equivalence.
│ │ │ │ The what() virtual function may simply be a string literal of the class name of
│ │ │ │ your _a_l_e_r_t.
│ │ │ │ For more information, see the _a_l_e_r_t_ _s_e_c_t_i_o_n.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ +************ ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e_._h_p_p"
│ │ │ │ +the _p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e class provides a handle to the internal peer
│ │ │ │ +connection object, to be used by plugins. This is a low level interface that
│ │ │ │ +may not be stable across libtorrent versions
│ │ │ │ +struct peer_connection_handle
│ │ │ │ +{
│ │ │ │ + explicit ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee (std::weak_ptr impl);
│ │ │ │ + connection_type ttyyppee () const;
│ │ │ │ + peer_plugin const* ffiinndd__pplluuggiinn (string_view type) const;
│ │ │ │ + void aadddd__eexxtteennssiioonn (std::shared_ptr);
│ │ │ │ + bool iiss__sseeeedd () const;
│ │ │ │ + bool uuppllooaadd__oonnllyy () const;
│ │ │ │ + peer_id const& ppiidd () const;
│ │ │ │ + bool hhaass__ppiieeccee (piece_index_t i) const;
│ │ │ │ + bool iiss__cchhookkeedd () const;
│ │ │ │ + bool iiss__iinntteerreessttiinngg () const;
│ │ │ │ + bool iiss__ppeeeerr__iinntteerreesstteedd () const;
│ │ │ │ + bool hhaass__ppeeeerr__cchhookkeedd () const;
│ │ │ │ + void cchhookkee__tthhiiss__ppeeeerr ();
│ │ │ │ + void mmaayybbee__uunncchhookkee__tthhiiss__ppeeeerr ();
│ │ │ │ + void ggeett__ppeeeerr__iinnffoo (peer_info& p) const;
│ │ │ │ + torrent_handle aassssoocciiaatteedd__ttoorrrreenntt () const;
│ │ │ │ + _t_c_p_:_:_e_n_d_p_o_i_n_t llooccaall__eennddppooiinntt () const;
│ │ │ │ + _t_c_p_:_:_e_n_d_p_o_i_n_t const& rreemmoottee () const;
│ │ │ │ + bool iiss__oouuttggooiinngg () const;
│ │ │ │ + bool iiss__ccoonnnneeccttiinngg () const;
│ │ │ │ + bool iiss__ddiissccoonnnneeccttiinngg () const;
│ │ │ │ + void ddiissccoonnnneecctt (error_code const& ec, operation_t op
│ │ │ │ + , disconnect_severity_t = peer_connection_interface::normal);
│ │ │ │ + bool oonn__llooccaall__nneettwwoorrkk () const;
│ │ │ │ + bool iiggnnoorree__uunncchhookkee__sslloottss () const;
│ │ │ │ + bool ffaaiilleedd () const;
│ │ │ │ + bool sshhoouulldd__lloogg (peer_log_alert::direction_t direction) const;
│ │ │ │ + void ppeeeerr__lloogg (peer_log_alert::direction_t direction
│ │ │ │ + , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT
│ │ │ │ +(4,5);
│ │ │ │ + bool ccaann__ddiissccoonnnneecctt (error_code const& ec) const;
│ │ │ │ + bool hhaass__mmeettaaddaattaa () const;
│ │ │ │ + bool iinn__hhaannddsshhaakkee () const;
│ │ │ │ + void sseenndd__bbuuffffeerr (char const* begin, int size);
│ │ │ │ + std::time_t llaasstt__sseeeenn__ccoommpplleettee () const;
│ │ │ │ + time_point ttiimmee__ooff__llaasstt__uunncchhookkee () const;
│ │ │ │ + bool ooppeerraattoorr<< (peer_connection_handle const& o) const;
│ │ │ │ + bool ooppeerraattoorr==== (peer_connection_handle const& o) const;
│ │ │ │ + bool ooppeerraattoorr!!== (peer_connection_handle const& o) const;
│ │ │ │ + std::shared_ptr nnaattiivvee__hhaannddllee () const;
│ │ │ │ +};
│ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ +************ bbtt__ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e_._h_p_p"
│ │ │ │ +The _b_t___p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e provides a handle to the internal bittorrent peer
│ │ │ │ +connection object to plugins. It's low level and may not be a stable API across
│ │ │ │ +libtorrent versions.
│ │ │ │ +struct bt_peer_connection_handle : peer_connection_handle
│ │ │ │ +{
│ │ │ │ + explicit bbtt__ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee (peer_connection_handle pc);
│ │ │ │ + bool ppaacckkeett__ffiinniisshheedd () const;
│ │ │ │ + bool ssuuppppoorrtt__eexxtteennssiioonnss () const;
│ │ │ │ + bool ssuuppppoorrttss__eennccrryyppttiioonn () const;
│ │ │ │ + void sswwiittcchh__sseenndd__ccrryyppttoo (std::shared_ptr crypto);
│ │ │ │ + void sswwiittcchh__rreeccvv__ccrryyppttoo (std::shared_ptr crypto);
│ │ │ │ + std::shared_ptr nnaattiivvee__hhaannddllee () const;
│ │ │ │ +};
│ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ pplluuggiinn ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_._h_p_p"
│ │ │ │ this is the base class for a _s_e_s_s_i_o_n _p_l_u_g_i_n. One primary feature is that it is
│ │ │ │ notified of all torrents that are added to the _s_e_s_s_i_o_n, and can add its own
│ │ │ │ torrent_plugins.
│ │ │ │ struct plugin
│ │ │ │ {
│ │ │ │ @@ -256,16 +321,16 @@
│ │ │ │ Torrent plugins are associated with a single torrent and have a number of
│ │ │ │ functions called at certain events. Many of its functions have the ability to
│ │ │ │ change or override the default libtorrent behavior.
│ │ │ │ struct torrent_plugin
│ │ │ │ {
│ │ │ │ virtual std::shared_ptr nneeww__ccoonnnneeccttiioonn (peer_connection_handle
│ │ │ │ const&);
│ │ │ │ - virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ virtual void oonn__ppiieeccee__ppaassss (piece_index_t);
│ │ │ │ + virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ virtual void ttiicckk ();
│ │ │ │ virtual bool oonn__rreessuummee ();
│ │ │ │ virtual bool oonn__ppaauussee ();
│ │ │ │ virtual void oonn__ffiilleess__cchheecckkeedd ();
│ │ │ │ virtual void oonn__ssttaattee (torrent_status::state_t);
│ │ │ │ virtual void oonn__aadddd__ppeeeerr (tcp::endpoint const&,
│ │ │ │ peer_source_flags_t, add_peer_flags_t);
│ │ │ │ @@ -286,16 +351,16 @@
│ │ │ │ The peer_connection_handle will be valid as long as the shared_ptr is being
│ │ │ │ held by the torrent object. So, it is generally a good idea to not keep a
│ │ │ │ shared_ptr to your own _p_e_e_r___p_l_u_g_i_n. If you want to keep references to it, use
│ │ │ │ weak_ptr.
│ │ │ │ If this function throws an exception, the connection will be closed.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** oonn__ppiieeccee__ppaassss(()) oonn__ppiieeccee__ffaaiilleedd(()) **********
│ │ │ │ -virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ virtual void oonn__ppiieeccee__ppaassss (piece_index_t);
│ │ │ │ +virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ These hooks are called when a piece passes the hash check or fails the hash
│ │ │ │ check, respectively. The index is the piece index that was downloaded. It is
│ │ │ │ possible to access the list of peers that participated in sending the piece
│ │ │ │ through the torrent and the piece_picker.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** ttiicckk(()) **********
│ │ │ │ virtual void ttiicckk ();
│ │ │ │ @@ -354,51 +419,51 @@
│ │ │ │ {
│ │ │ │ virtual string_view ttyyppee () const;
│ │ │ │ virtual void aadddd__hhaannddsshhaakkee (entry&);
│ │ │ │ virtual void oonn__ddiissccoonnnneecctt (error_code const&);
│ │ │ │ virtual void oonn__ccoonnnneecctteedd ();
│ │ │ │ virtual bool oonn__hhaannddsshhaakkee (span);
│ │ │ │ virtual bool oonn__eexxtteennssiioonn__hhaannddsshhaakkee (bdecode_node const&);
│ │ │ │ - virtual bool oonn__hhaavvee__nnoonnee ();
│ │ │ │ + virtual bool oonn__hhaavvee__aallll ();
│ │ │ │ + virtual bool oonn__ddoonntt__hhaavvee (piece_index_t);
│ │ │ │ + virtual bool oonn__cchhookkee ();
│ │ │ │ virtual bool oonn__hhaavvee (piece_index_t);
│ │ │ │ - virtual bool oonn__rreeqquueesstt (peer_request const&);
│ │ │ │ - virtual bool oonn__nnoott__iinntteerreesstteedd ();
│ │ │ │ - virtual bool oonn__aalllloowweedd__ffaasstt (piece_index_t);
│ │ │ │ - virtual bool oonn__bbiittffiieelldd (bitfield const& //**bbiittffiieelldd**//);
│ │ │ │ virtual bool oonn__iinntteerreesstteedd ();
│ │ │ │ - virtual bool oonn__cchhookkee ();
│ │ │ │ + virtual bool oonn__aalllloowweedd__ffaasstt (piece_index_t);
│ │ │ │ + virtual bool oonn__hhaavvee__nnoonnee ();
│ │ │ │ + virtual bool oonn__rreeqquueesstt (peer_request const&);
│ │ │ │ virtual bool oonn__uunncchhookkee ();
│ │ │ │ - virtual bool oonn__hhaavvee__aallll ();
│ │ │ │ - virtual bool oonn__ddoonntt__hhaavvee (piece_index_t);
│ │ │ │ + virtual bool oonn__bbiittffiieelldd (bitfield const& //**bbiittffiieelldd**//);
│ │ │ │ + virtual bool oonn__nnoott__iinntteerreesstteedd ();
│ │ │ │ virtual bool oonn__ppiieeccee (peer_request const& //**ppiieeccee**//
│ │ │ │ , span //**bbuuff**//);
│ │ │ │ - virtual bool oonn__rreejjeecctt (peer_request const&);
│ │ │ │ virtual bool oonn__ssuuggggeesstt (piece_index_t);
│ │ │ │ virtual bool oonn__ccaanncceell (peer_request const&);
│ │ │ │ - virtual void sseenntt__aallllooww__ffaasstt (piece_index_t);
│ │ │ │ - virtual void sseenntt__cchhookkee ();
│ │ │ │ + virtual bool oonn__rreejjeecctt (peer_request const&);
│ │ │ │ virtual void sseenntt__hhaavvee__aallll ();
│ │ │ │ virtual void sseenntt__ssuuggggeesstt (piece_index_t);
│ │ │ │ - virtual void sseenntt__rreeqquueesstt (peer_request const&);
│ │ │ │ - virtual void sseenntt__hhaavvee__nnoonnee ();
│ │ │ │ virtual void sseenntt__rreejjeecctt__rreeqquueesstt (peer_request const&);
│ │ │ │ + virtual void sseenntt__hhaavvee__nnoonnee ();
│ │ │ │ virtual void sseenntt__ccaanncceell (peer_request const&);
│ │ │ │ + virtual void sseenntt__aallllooww__ffaasstt (piece_index_t);
│ │ │ │ + virtual void sseenntt__rreeqquueesstt (peer_request const&);
│ │ │ │ + virtual void sseenntt__cchhookkee ();
│ │ │ │ virtual void sseenntt__hhaavvee (piece_index_t);
│ │ │ │ + virtual void sseenntt__uunncchhookkee ();
│ │ │ │ virtual void sseenntt__iinntteerreesstteedd ();
│ │ │ │ - virtual void sseenntt__ppiieeccee (peer_request const&);
│ │ │ │ virtual void sseenntt__nnoott__iinntteerreesstteedd ();
│ │ │ │ - virtual void sseenntt__uunncchhookkee ();
│ │ │ │ + virtual void sseenntt__ppiieeccee (peer_request const&);
│ │ │ │ virtual void sseenntt__ppaayyllooaadd (int //** bbyytteess **//);
│ │ │ │ virtual bool ccaann__ddiissccoonnnneecctt (error_code const& //**eecc**//);
│ │ │ │ virtual bool oonn__eexxtteennddeedd (int //**lleennggtthh**//, int //**mmssgg**//,
│ │ │ │ span //**bbooddyy**//);
│ │ │ │ virtual bool oonn__uunnkknnoowwnn__mmeessssaaggee (int //**lleennggtthh**//, int //**mmssgg**//,
│ │ │ │ span //**bbooddyy**//);
│ │ │ │ - virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ virtual void oonn__ppiieeccee__ppaassss (piece_index_t);
│ │ │ │ + virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ virtual void ttiicckk ();
│ │ │ │ virtual bool wwrriittee__rreeqquueesstt (peer_request const&);
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** ttyyppee(()) **********
│ │ │ │ virtual string_view ttyyppee () const;
│ │ │ │ This function is expected to return the name of the _p_l_u_g_i_n.
│ │ │ │ @@ -426,48 +491,48 @@
│ │ │ │ ********** oonn__eexxtteennssiioonn__hhaannddsshhaakkee(()) **********
│ │ │ │ virtual bool oonn__eexxtteennssiioonn__hhaannddsshhaakkee (bdecode_node const&);
│ │ │ │ called when the extension handshake from the other end is received if this
│ │ │ │ returns false, it means that this extension isn't supported by this peer. It
│ │ │ │ will result in this _p_e_e_r___p_l_u_g_i_n being removed from the peer_connection and
│ │ │ │ destructed. this is not called for web seeds
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__uunncchhookkee(()) oonn__hhaavvee__nnoonnee(()) oonn__nnoott__iinntteerreesstteedd(()) oonn__rreeqquueesstt(()) oonn__ddoonntt__hhaavvee
│ │ │ │ -(()) oonn__hhaavvee__aallll(()) oonn__bbiittffiieelldd(()) oonn__hhaavvee(()) oonn__aalllloowweedd__ffaasstt(()) oonn__cchhookkee(())
│ │ │ │ -oonn__iinntteerreesstteedd(()) **********
│ │ │ │ -virtual bool oonn__hhaavvee__nnoonnee ();
│ │ │ │ +********** oonn__hhaavvee(()) oonn__iinntteerreesstteedd(()) oonn__bbiittffiieelldd(()) oonn__aalllloowweedd__ffaasstt(()) oonn__rreeqquueesstt(())
│ │ │ │ +oonn__ddoonntt__hhaavvee(()) oonn__hhaavvee__nnoonnee(()) oonn__uunncchhookkee(()) oonn__cchhookkee(()) oonn__hhaavvee__aallll(())
│ │ │ │ +oonn__nnoott__iinntteerreesstteedd(()) **********
│ │ │ │ +virtual bool oonn__hhaavvee__aallll ();
│ │ │ │ +virtual bool oonn__ddoonntt__hhaavvee (piece_index_t);
│ │ │ │ +virtual bool oonn__cchhookkee ();
│ │ │ │ virtual bool oonn__hhaavvee (piece_index_t);
│ │ │ │ -virtual bool oonn__rreeqquueesstt (peer_request const&);
│ │ │ │ -virtual bool oonn__nnoott__iinntteerreesstteedd ();
│ │ │ │ -virtual bool oonn__aalllloowweedd__ffaasstt (piece_index_t);
│ │ │ │ -virtual bool oonn__bbiittffiieelldd (bitfield const& //**bbiittffiieelldd**//);
│ │ │ │ virtual bool oonn__iinntteerreesstteedd ();
│ │ │ │ -virtual bool oonn__cchhookkee ();
│ │ │ │ +virtual bool oonn__aalllloowweedd__ffaasstt (piece_index_t);
│ │ │ │ +virtual bool oonn__hhaavvee__nnoonnee ();
│ │ │ │ +virtual bool oonn__rreeqquueesstt (peer_request const&);
│ │ │ │ virtual bool oonn__uunncchhookkee ();
│ │ │ │ -virtual bool oonn__hhaavvee__aallll ();
│ │ │ │ -virtual bool oonn__ddoonntt__hhaavvee (piece_index_t);
│ │ │ │ +virtual bool oonn__bbiittffiieelldd (bitfield const& //**bbiittffiieelldd**//);
│ │ │ │ +virtual bool oonn__nnoott__iinntteerreesstteedd ();
│ │ │ │ returning true from any of the message handlers indicates that the _p_l_u_g_i_n has
│ │ │ │ handled the message. it will break the _p_l_u_g_i_n chain traversing and not let
│ │ │ │ anyone else handle the message, including the default handler.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** oonn__ppiieeccee(()) **********
│ │ │ │ virtual bool oonn__ppiieeccee (peer_request const& //**ppiieeccee**//
│ │ │ │ , span //**bbuuff**//);
│ │ │ │ This function is called when the peer connection is receiving a piece. buf
│ │ │ │ points (non-owning pointer) to the data in an internal immutable disk buffer.
│ │ │ │ The length of the data is specified in the length member of the piece
│ │ │ │ parameter. returns true to indicate that the piece is handled and the rest of
│ │ │ │ the logic should be ignored.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseenntt__uunncchhookkee(()) sseenntt__hhaavvee(()) sseenntt__nnoott__iinntteerreesstteedd(()) sseenntt__ppiieeccee(())
│ │ │ │ +********** sseenntt__ppiieeccee(()) sseenntt__uunncchhookkee(()) sseenntt__nnoott__iinntteerreesstteedd(()) sseenntt__hhaavvee(())
│ │ │ │ sseenntt__iinntteerreesstteedd(()) **********
│ │ │ │ virtual void sseenntt__hhaavvee (piece_index_t);
│ │ │ │ +virtual void sseenntt__uunncchhookkee ();
│ │ │ │ virtual void sseenntt__iinntteerreesstteedd ();
│ │ │ │ -virtual void sseenntt__ppiieeccee (peer_request const&);
│ │ │ │ virtual void sseenntt__nnoott__iinntteerreesstteedd ();
│ │ │ │ -virtual void sseenntt__uunncchhookkee ();
│ │ │ │ +virtual void sseenntt__ppiieeccee (peer_request const&);
│ │ │ │ called after a choke message has been sent to the peer
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** sseenntt__ppaayyllooaadd(()) **********
│ │ │ │ virtual void sseenntt__ppaayyllooaadd (int //** bbyytteess **//);
│ │ │ │ called after piece data has been sent to the peer this can be used for stats
│ │ │ │ book keeping
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ @@ -491,16 +556,16 @@
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** oonn__uunnkknnoowwnn__mmeessssaaggee(()) **********
│ │ │ │ virtual bool oonn__uunnkknnoowwnn__mmeessssaaggee (int //**lleennggtthh**//, int //**mmssgg**//,
│ │ │ │ span //**bbooddyy**//);
│ │ │ │ this is not called for web seeds
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** oonn__ppiieeccee__ppaassss(()) oonn__ppiieeccee__ffaaiilleedd(()) **********
│ │ │ │ -virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ virtual void oonn__ppiieeccee__ppaassss (piece_index_t);
│ │ │ │ +virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ called when a piece that this peer participated in either fails or passes the
│ │ │ │ hash_check
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** ttiicckk(()) **********
│ │ │ │ virtual void ttiicckk ();
│ │ │ │ called approximately once every second
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ @@ -510,16 +575,16 @@
│ │ │ │ original request message won't be sent and no other _p_l_u_g_i_n will have this
│ │ │ │ function called.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ ccrryyppttoo__pplluuggiinn ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_._h_p_p"
│ │ │ │ struct crypto_plugin
│ │ │ │ {
│ │ │ │ - virtual void sseett__iinnccoommiinngg__kkeeyy (span key) = 0;
│ │ │ │ virtual void sseett__oouuttggooiinngg__kkeeyy (span key) = 0;
│ │ │ │ + virtual void sseett__iinnccoommiinngg__kkeeyy (span key) = 0;
│ │ │ │ eennccrryypptt (span> //**sseenndd__vveecc**//) = 0;
│ │ │ │ virtual std::tuple ddeeccrryypptt (span> //**rreecceeiivvee__vveecc**//
│ │ │ │ ) = 0;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** ddeeccrryypptt(()) **********
│ │ │ │ virtual std::tuple ddeeccrryypptt (span> //**rreecceeiivvee__vveecc**//) =
│ │ │ │ @@ -529,79 +594,14 @@
│ │ │ │ consume is set to the number of bytes which should be trimmed from the head of
│ │ │ │ the buffers, default is 0
│ │ │ │ produce is set to the number of bytes of payload which are now ready to be sent
│ │ │ │ to the upper layer. default is the number of bytes passed in receive_vec
│ │ │ │ packet_size is set to the minimum number of bytes which must be read to advance
│ │ │ │ the next step of decryption. default is 0
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e_._h_p_p"
│ │ │ │ -the _p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e class provides a handle to the internal peer
│ │ │ │ -connection object, to be used by plugins. This is a low level interface that
│ │ │ │ -may not be stable across libtorrent versions
│ │ │ │ -struct peer_connection_handle
│ │ │ │ -{
│ │ │ │ - explicit ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee (std::weak_ptr impl);
│ │ │ │ - connection_type ttyyppee () const;
│ │ │ │ - peer_plugin const* ffiinndd__pplluuggiinn (string_view type) const;
│ │ │ │ - void aadddd__eexxtteennssiioonn (std::shared_ptr);
│ │ │ │ - bool iiss__sseeeedd () const;
│ │ │ │ - bool uuppllooaadd__oonnllyy () const;
│ │ │ │ - peer_id const& ppiidd () const;
│ │ │ │ - bool hhaass__ppiieeccee (piece_index_t i) const;
│ │ │ │ - bool iiss__iinntteerreessttiinngg () const;
│ │ │ │ - bool iiss__cchhookkeedd () const;
│ │ │ │ - bool iiss__ppeeeerr__iinntteerreesstteedd () const;
│ │ │ │ - bool hhaass__ppeeeerr__cchhookkeedd () const;
│ │ │ │ - void cchhookkee__tthhiiss__ppeeeerr ();
│ │ │ │ - void mmaayybbee__uunncchhookkee__tthhiiss__ppeeeerr ();
│ │ │ │ - void ggeett__ppeeeerr__iinnffoo (peer_info& p) const;
│ │ │ │ - torrent_handle aassssoocciiaatteedd__ttoorrrreenntt () const;
│ │ │ │ - _t_c_p_:_:_e_n_d_p_o_i_n_t const& rreemmoottee () const;
│ │ │ │ - _t_c_p_:_:_e_n_d_p_o_i_n_t llooccaall__eennddppooiinntt () const;
│ │ │ │ - void ddiissccoonnnneecctt (error_code const& ec, operation_t op
│ │ │ │ - , disconnect_severity_t = peer_connection_interface::normal);
│ │ │ │ - bool iiss__oouuttggooiinngg () const;
│ │ │ │ - bool iiss__ccoonnnneeccttiinngg () const;
│ │ │ │ - bool iiss__ddiissccoonnnneeccttiinngg () const;
│ │ │ │ - bool oonn__llooccaall__nneettwwoorrkk () const;
│ │ │ │ - bool iiggnnoorree__uunncchhookkee__sslloottss () const;
│ │ │ │ - bool ffaaiilleedd () const;
│ │ │ │ - bool sshhoouulldd__lloogg (peer_log_alert::direction_t direction) const;
│ │ │ │ - void ppeeeerr__lloogg (peer_log_alert::direction_t direction
│ │ │ │ - , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT
│ │ │ │ -(4,5);
│ │ │ │ - bool ccaann__ddiissccoonnnneecctt (error_code const& ec) const;
│ │ │ │ - bool hhaass__mmeettaaddaattaa () const;
│ │ │ │ - bool iinn__hhaannddsshhaakkee () const;
│ │ │ │ - void sseenndd__bbuuffffeerr (char const* begin, int size);
│ │ │ │ - std::time_t llaasstt__sseeeenn__ccoommpplleettee () const;
│ │ │ │ - time_point ttiimmee__ooff__llaasstt__uunncchhookkee () const;
│ │ │ │ - bool ooppeerraattoorr==== (peer_connection_handle const& o) const;
│ │ │ │ - bool ooppeerraattoorr<< (peer_connection_handle const& o) const;
│ │ │ │ - bool ooppeerraattoorr!!== (peer_connection_handle const& o) const;
│ │ │ │ - std::shared_ptr nnaattiivvee__hhaannddllee () const;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ bbtt__ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e_._h_p_p"
│ │ │ │ -The _b_t___p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e provides a handle to the internal bittorrent peer
│ │ │ │ -connection object to plugins. It's low level and may not be a stable API across
│ │ │ │ -libtorrent versions.
│ │ │ │ -struct bt_peer_connection_handle : peer_connection_handle
│ │ │ │ -{
│ │ │ │ - explicit bbtt__ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee (peer_connection_handle pc);
│ │ │ │ - bool ppaacckkeett__ffiinniisshheedd () const;
│ │ │ │ - bool ssuuppppoorrtt__eexxtteennssiioonnss () const;
│ │ │ │ - bool ssuuppppoorrttss__eennccrryyppttiioonn () const;
│ │ │ │ - void sswwiittcchh__sseenndd__ccrryyppttoo (std::shared_ptr crypto);
│ │ │ │ - void sswwiittcchh__rreeccvv__ccrryyppttoo (std::shared_ptr crypto);
│ │ │ │ - std::shared_ptr nnaattiivvee__hhaannddllee () const;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ ccrreeaattee__uutt__ppeexx__pplluuggiinn(()) ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_/_u_t___p_e_x_._h_p_p"
│ │ │ │ std::shared_ptr ccrreeaattee__uutt__ppeexx__pplluuggiinn (torrent_handle const&,
│ │ │ │ client_data_t);
│ │ │ │ constructor function for the ut_pex extension. The ut_pex extension allows
│ │ │ │ peers to gossip about their connections, allowing the swarm stay well connected
│ │ │ │ and peers aware of more peers in the swarm. This extension is enabled by
│ │ ├── ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Resume_Data.html
│ │ │ @@ -29,31 +29,31 @@
│ │ │
│ │ │
│ │ │ home
│ │ │
│ │ │
Table of contents
│ │ │
│ │ │
│ │ │ [report issue]
│ │ │
read_resume_data()
│ │ │
Declared in "libtorrent/read_resume_data.hpp"
│ │ │
│ │ │ add_torrent_params read_resume_data (span<char const> buffer
│ │ │ + , load_torrent_limits const& cfg = {});
│ │ │ +add_torrent_params read_resume_data (span<char const> buffer
│ │ │ , error_code& ec, load_torrent_limits const& cfg = {});
│ │ │ add_torrent_params read_resume_data (bdecode_node const& rd
│ │ │ - , error_code& ec, int piece_limit = 0x200000);
│ │ │ -add_torrent_params read_resume_data (bdecode_node const& rd
│ │ │ , int piece_limit = 0x200000);
│ │ │ -add_torrent_params read_resume_data (span<char const> buffer
│ │ │ - , load_torrent_limits const& cfg = {});
│ │ │ +add_torrent_params read_resume_data (bdecode_node const& rd
│ │ │ + , error_code& ec, int piece_limit = 0x200000);
│ │ │
│ │ │
these functions are used to parse resume data and populate the appropriate
│ │ │ fields in an add_torrent_params object. This object can then be used to add
│ │ │ the actual torrent_info object to and pass to session::add_torrent() or
│ │ │ session::async_add_torrent().
│ │ │
If the client wants to override any field that was loaded from the resume
│ │ │ data, e.g. save_path, those fields must be changed after loading resume
│ │ │ @@ -61,18 +61,18 @@
│ │ │
The piece_limit parameter determines the largest number of pieces
│ │ │ allowed in the torrent that may be loaded as part of the resume data, if
│ │ │ it contains an info field. The overloads that take a flat buffer are
│ │ │ instead configured with limits on torrent sizes via load_torrent limits.
│ │ │
In order to support large torrents, it may also be necessary to raise the
│ │ │ settings_pack::max_piece_count setting and pass a higher limit to calls
│ │ │ to torrent_info::parse_info_section().
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
write_resume_data_buf() write_resume_data()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
write_resume_data() write_resume_data_buf()
│ │ │
Declared in "libtorrent/write_resume_data.hpp"
│ │ │
│ │ │ std::vector<char> write_resume_data_buf (add_torrent_params const& atp);
│ │ │ entry write_resume_data (add_torrent_params const& atp);
│ │ │
│ │ │
this function turns the resume data in an add_torrent_params object
│ │ │ into a bencoded structure
│ │ │ ├── html2text {}
│ │ │ │ @@ -1,27 +1,27 @@
│ │ │ │ >
│ │ │ │ _[_l_i_b_t_o_r_r_e_n_t_ _l_o_g_o_]
│ │ │ │ VVeerrssiioonn:: 2.0.11
│ │ │ │ _h_o_m_e
│ │ │ │ Table of contents
│ │ │ │ * _r_e_a_d___r_e_s_u_m_e___d_a_t_a_(_)
│ │ │ │ - * _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a___b_u_f_(_)_ _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a_(_)
│ │ │ │ + * _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a_(_)_ _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a___b_u_f_(_)
│ │ │ │ * _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e_(_)_ _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e___b_u_f_(_)
│ │ │ │ * _w_r_i_t_e___t_o_r_r_e_n_t___f_l_a_g_s___t
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ rreeaadd__rreessuummee__ddaattaa(()) ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_r_e_a_d___r_e_s_u_m_e___d_a_t_a_._h_p_p"
│ │ │ │ add_torrent_params rreeaadd__rreessuummee__ddaattaa (span
buffer
│ │ │ │ + , load_torrent_limits const& cfg = {});
│ │ │ │ +add_torrent_params rreeaadd__rreessuummee__ddaattaa (span buffer
│ │ │ │ , error_code& ec, load_torrent_limits const& cfg = {});
│ │ │ │ add_torrent_params rreeaadd__rreessuummee__ddaattaa (bdecode_node const& rd
│ │ │ │ - , error_code& ec, int piece_limit = 0x200000);
│ │ │ │ -add_torrent_params rreeaadd__rreessuummee__ddaattaa (bdecode_node const& rd
│ │ │ │ , int piece_limit = 0x200000);
│ │ │ │ -add_torrent_params rreeaadd__rreessuummee__ddaattaa (span buffer
│ │ │ │ - , load_torrent_limits const& cfg = {});
│ │ │ │ +add_torrent_params rreeaadd__rreessuummee__ddaattaa (bdecode_node const& rd
│ │ │ │ + , error_code& ec, int piece_limit = 0x200000);
│ │ │ │ these functions are used to parse resume data and populate the appropriate
│ │ │ │ fields in an _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s object. This object can then be used to add the
│ │ │ │ actual _t_o_r_r_e_n_t___i_n_f_o object to and pass to session::add_torrent() or session::
│ │ │ │ async_add_torrent().
│ │ │ │ If the client wants to override any field that was loaded from the resume data,
│ │ │ │ e.g. save_path, those fields must be changed after loading resume data but
│ │ │ │ before adding the torrent.
│ │ │ │ @@ -29,15 +29,15 @@
│ │ │ │ the torrent that may be loaded as part of the resume data, if it contains an
│ │ │ │ info field. The overloads that take a flat buffer are instead configured with
│ │ │ │ limits on torrent sizes via load_torrent limits.
│ │ │ │ In order to support large torrents, it may also be necessary to raise the
│ │ │ │ _s_e_t_t_i_n_g_s___p_a_c_k_:_:_m_a_x___p_i_e_c_e___c_o_u_n_t setting and pass a higher limit to calls to
│ │ │ │ _t_o_r_r_e_n_t___i_n_f_o_:_:_p_a_r_s_e___i_n_f_o___s_e_c_t_i_o_n_(_).
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ wwrriittee__rreessuummee__ddaattaa__bbuuff(()) wwrriittee__rreessuummee__ddaattaa(()) ************
│ │ │ │ +************ wwrriittee__rreessuummee__ddaattaa(()) wwrriittee__rreessuummee__ddaattaa__bbuuff(()) ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_w_r_i_t_e___r_e_s_u_m_e___d_a_t_a_._h_p_p"
│ │ │ │ std::vector wwrriittee__rreessuummee__ddaattaa__bbuuff (add_torrent_params const& atp);
│ │ │ │ entry wwrriittee__rreessuummee__ddaattaa (add_torrent_params const& atp);
│ │ │ │ this function turns the resume data in an add_torrent_params object into a
│ │ │ │ bencoded structure
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ wwrriittee__ttoorrrreenntt__ffiillee(()) wwrriittee__ttoorrrreenntt__ffiillee__bbuuff(()) ************
│ │ ├── ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html
│ │ │ @@ -34,109 +34,109 @@
│ │ │
│ │ │
│ │ │ [report issue]
│ │ │
session_params
│ │ │
Declared in "libtorrent/session_params.hpp"
│ │ │
The session_params is a parameters pack for configuring the session
│ │ │ before it's started.
│ │ │
│ │ │ struct session_params
│ │ │ {
│ │ │ - session_params ();
│ │ │ session_params (settings_pack const& sp);
│ │ │ session_params (settings_pack&& sp);
│ │ │ - session_params (settings_pack&& sp
│ │ │ - , std::vector<std::shared_ptr<plugin>> exts);
│ │ │ + session_params ();
│ │ │ session_params (settings_pack const& sp
│ │ │ , std::vector<std::shared_ptr<plugin>> exts);
│ │ │ + session_params (settings_pack&& sp
│ │ │ + , std::vector<std::shared_ptr<plugin>> exts);
│ │ │
│ │ │ settings_pack settings;
│ │ │ std::vector<std::shared_ptr<plugin>> extensions;
│ │ │ dht::dht_state dht_state;
│ │ │ dht::dht_storage_constructor_type dht_storage_constructor;
│ │ │ disk_io_constructor_type disk_io_constructor;
│ │ │ std::map<std::string, std::string> ext_state;
│ │ │ libtorrent::ip_filter ip_filter;
│ │ │ };
│ │ │
│ │ │
[report issue]
│ │ │
session_params()
│ │ │
│ │ │ -session_params ();
│ │ │ session_params (settings_pack const& sp);
│ │ │ session_params (settings_pack&& sp);
│ │ │ +session_params ();
│ │ │
│ │ │
This constructor can be used to start with the default plugins
│ │ │ (ut_metadata, ut_pex and smart_ban). Pass a settings_pack to set the
│ │ │ initial settings when the session starts.
│ │ │
[report issue]
│ │ │
│ │ │
session_params()
│ │ │
│ │ │ -session_params (settings_pack&& sp
│ │ │ - , std::vector<std::shared_ptr<plugin>> exts);
│ │ │ session_params (settings_pack const& sp
│ │ │ , std::vector<std::shared_ptr<plugin>> exts);
│ │ │ +session_params (settings_pack&& sp
│ │ │ + , std::vector<std::shared_ptr<plugin>> exts);
│ │ │
│ │ │
This constructor helps to configure the set of initial plugins
│ │ │ to be added to the session before it's started.
│ │ │
[report issue]
│ │ │ - settings
│ │ │ - The settings to configure the session with
│ │ │
│ │ │ @@ -178,33 +178,33 @@
│ │ │ synchronize the completion of the shutdown. The lifetime of this object
│ │ │ may outlive
session, causing the
session destructor to not block. The
│ │ │
session_proxy destructor will block however, until the underlying
session
│ │ │ is done shutting down.
│ │ │
│ │ │ struct session_proxy
│ │ │ {
│ │ │ - session_proxy (session_proxy const&);
│ │ │ - session_proxy& operator= (session_proxy&&) & noexcept;
│ │ │ - session_proxy& operator= (session_proxy const&) &;
│ │ │ session_proxy (session_proxy&&) noexcept;
│ │ │ - ~session_proxy ();
│ │ │ + session_proxy (session_proxy const&);
│ │ │ session_proxy ();
│ │ │ + ~session_proxy ();
│ │ │ + session_proxy& operator= (session_proxy const&) &;
│ │ │ + session_proxy& operator= (session_proxy&&) & noexcept;
│ │ │ };
│ │ │
│ │ │ -
│ │ │
│ │ │ -
[report issue]
│ │ │ -
~session_proxy() operator=() session_proxy()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
operator=() ~session_proxy() session_proxy()
│ │ │
│ │ │ -session_proxy (session_proxy const&);
│ │ │ -session_proxy& operator= (session_proxy&&) & noexcept;
│ │ │ -session_proxy& operator= (session_proxy const&) &;
│ │ │ session_proxy (session_proxy&&) noexcept;
│ │ │ -~session_proxy ();
│ │ │ +session_proxy (session_proxy const&);
│ │ │ session_proxy ();
│ │ │ +~session_proxy ();
│ │ │ +session_proxy& operator= (session_proxy const&) &;
│ │ │ +session_proxy& operator= (session_proxy&&) & noexcept;
│ │ │
│ │ │
default constructor, does not refer to any session
│ │ │ implementation object.
│ │ │
[report issue]
│ │ │
│ │ │
│ │ │
session
│ │ │ @@ -218,52 +218,52 @@
│ │ │
session_handle::apply_settings() member function. To change one or more
│ │ │ configuration options, create a
settings_pack. object and fill it with
│ │ │ the settings to be set and pass it in to
session::apply_settings().
│ │ │
see apply_settings().
│ │ │
│ │ │ struct session : session_handle
│ │ │ {
│ │ │ - session (session_params const& params, session_flags_t flags);
│ │ │ session (session_params&& params, session_flags_t flags);
│ │ │ - explicit session (session_params&& params);
│ │ │ session ();
│ │ │ explicit session (session_params const& params);
│ │ │ - session (session_params&& params, io_context& ios);
│ │ │ + session (session_params const& params, session_flags_t flags);
│ │ │ + explicit session (session_params&& params);
│ │ │ + session (session_params const& params, io_context& ios);
│ │ │ session (session_params const& params, io_context& ios, session_flags_t);
│ │ │ + session (session_params&& params, io_context& ios);
│ │ │ session (session_params&& params, io_context& ios, session_flags_t);
│ │ │ - session (session_params const& params, io_context& ios);
│ │ │ ~session ();
│ │ │ session_proxy abort ();
│ │ │ };
│ │ │
│ │ │
[report issue]
│ │ │
session()
│ │ │
│ │ │ -session (session_params const& params, session_flags_t flags);
│ │ │ session (session_params&& params, session_flags_t flags);
│ │ │ -explicit session (session_params&& params);
│ │ │ session ();
│ │ │ explicit session (session_params const& params);
│ │ │ +session (session_params const& params, session_flags_t flags);
│ │ │ +explicit session (session_params&& params);
│ │ │
│ │ │
Constructs the session objects which acts as the container of torrents.
│ │ │ In order to avoid a race condition between starting the session and
│ │ │ configuring it, you can pass in a session_params object. Its settings
│ │ │ will take effect before the session starts up.
│ │ │
The overloads taking flags can be used to start a session in
│ │ │ paused mode (by passing in session::paused). Note that
│ │ │ add_default_plugins do not have an affect on constructors that
│ │ │ take a session_params object. It already contains the plugins to use.
│ │ │
[report issue]
│ │ │
│ │ │
session()
│ │ │
│ │ │ -session (session_params&& params, io_context& ios);
│ │ │ +session (session_params const& params, io_context& ios);
│ │ │ session (session_params const& params, io_context& ios, session_flags_t);
│ │ │ +session (session_params&& params, io_context& ios);
│ │ │ session (session_params&& params, io_context& ios, session_flags_t);
│ │ │ -session (session_params const& params, io_context& ios);
│ │ │
│ │ │
Overload of the constructor that takes an external io_context to run
│ │ │ the session object on. This is primarily useful for tests that may want
│ │ │ to run multiple sessions on a single io_context, or low resource
│ │ │ systems where additional threads are expensive and sharing an
│ │ │ io_context with other events is fine.
│ │ │
│ │ │
│ │ │
│ │ │
session_handle
│ │ │
Declared in "libtorrent/session_handle.hpp"
│ │ │
this class provides a non-owning handle to a session and a subset of the
│ │ │ interface of the session class. If the underlying session is destructed
│ │ │ -any handle to it will no longer be valid. is_valid() will return false and
│ │ │ +any handle to it will no longer be valid. is_valid() will return false and
│ │ │ any operation on it will throw a system_error exception, with error code
│ │ │ invalid_session_handle.
│ │ │
│ │ │ struct session_handle
│ │ │ {
│ │ │ bool is_valid () const;
│ │ │ session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;
│ │ │ + void refresh_torrent_status (std::vector<torrent_status>* ret
│ │ │ + , status_flags_t flags = {}) const;
│ │ │ std::vector<torrent_status> get_torrent_status (
│ │ │ std::function<bool(torrent_status const&)> const& pred
│ │ │ , status_flags_t flags = {}) const;
│ │ │ - void refresh_torrent_status (std::vector<torrent_status>* ret
│ │ │ - , status_flags_t flags = {}) const;
│ │ │ void post_torrent_updates (status_flags_t flags = status_flags_t::all());
│ │ │ void post_session_stats ();
│ │ │ void post_dht_stats ();
│ │ │ void set_dht_state (dht::dht_state&& st);
│ │ │ void set_dht_state (dht::dht_state const& st);
│ │ │ - std::vector<torrent_handle> get_torrents () const;
│ │ │ torrent_handle find_torrent (sha1_hash const& info_hash) const;
│ │ │ - torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);
│ │ │ - void async_add_torrent (add_torrent_params const& params);
│ │ │ + std::vector<torrent_handle> get_torrents () const;
│ │ │ void async_add_torrent (add_torrent_params&& params);
│ │ │ + torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);
│ │ │ torrent_handle add_torrent (add_torrent_params const& params);
│ │ │ + torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);
│ │ │ + void async_add_torrent (add_torrent_params const& params);
│ │ │ torrent_handle add_torrent (add_torrent_params&& params);
│ │ │ - torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);
│ │ │ void pause ();
│ │ │ bool is_paused () const;
│ │ │ void resume ();
│ │ │ bool is_dht_running () const;
│ │ │ void set_dht_storage (dht::dht_storage_constructor_type sc);
│ │ │ void add_dht_node (std::pair<std::string, int> const& node);
│ │ │ void dht_get_item (sha1_hash const& target);
│ │ │ @@ -355,38 +355,38 @@
│ │ │ , std::int64_t&, std::string const&)> cb
│ │ │ , std::string salt = std::string());
│ │ │ void dht_get_peers (sha1_hash const& info_hash);
│ │ │ void dht_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});
│ │ │ void dht_live_nodes (sha1_hash const& nid);
│ │ │ void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);
│ │ │ void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});
│ │ │ - void add_extension (std::shared_ptr<plugin> ext);
│ │ │ void add_extension (std::function<std::shared_ptr<torrent_plugin>(
│ │ │ torrent_handle const&, client_data_t)> ext);
│ │ │ - ip_filter get_ip_filter () const;
│ │ │ + void add_extension (std::shared_ptr<plugin> ext);
│ │ │ void set_ip_filter (ip_filter f);
│ │ │ + ip_filter get_ip_filter () const;
│ │ │ void set_port_filter (port_filter const& f);
│ │ │ + unsigned short listen_port () const;
│ │ │ unsigned short ssl_listen_port () const;
│ │ │ bool is_listening () const;
│ │ │ - unsigned short listen_port () const;
│ │ │ ip_filter get_peer_class_filter () const;
│ │ │ void set_peer_class_filter (ip_filter const& f);
│ │ │ - void set_peer_class_type_filter (peer_class_type_filter const& f);
│ │ │ peer_class_type_filter get_peer_class_type_filter () const;
│ │ │ + void set_peer_class_type_filter (peer_class_type_filter const& f);
│ │ │ peer_class_t create_peer_class (char const* name);
│ │ │ void delete_peer_class (peer_class_t cid);
│ │ │ void set_peer_class (peer_class_t cid, peer_class_info const& pci);
│ │ │ peer_class_info get_peer_class (peer_class_t cid) const;
│ │ │ void remove_torrent (const torrent_handle&, remove_flags_t = {});
│ │ │ + void apply_settings (settings_pack const&);
│ │ │ settings_pack get_settings () const;
│ │ │ void apply_settings (settings_pack&&);
│ │ │ - void apply_settings (settings_pack const&);
│ │ │ - alert* wait_for_alert (time_duration max_wait);
│ │ │ void pop_alerts (std::vector<alert*>* alerts);
│ │ │ void set_alert_notify (std::function<void()> const& fun);
│ │ │ + alert* wait_for_alert (time_duration max_wait);
│ │ │ void delete_port_mapping (port_mapping_t handle);
│ │ │ std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);
│ │ │ void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);
│ │ │ std::shared_ptr<aux::session_impl> native_handle () const;
│ │ │
│ │ │ static constexpr save_state_flags_t save_settings = 0_bit;
│ │ │ static constexpr save_state_flags_t save_dht_state = 2_bit;
│ │ │ @@ -420,24 +420,24 @@
│ │ │ returns the current session state. This can be passed to
│ │ │ write_session_params() to save the state to disk and restored using
│ │ │ read_session_params() when constructing a new session. The kind of
│ │ │ state that's included is all settings, the DHT routing table, possibly
│ │ │ plugin-specific state.
│ │ │ the flags parameter can be used to only save certain parts of the
│ │ │ session state
│ │ │ -
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
get_torrent_status() refresh_torrent_status()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
refresh_torrent_status() get_torrent_status()
│ │ │
│ │ │ +void refresh_torrent_status (std::vector<torrent_status>* ret
│ │ │ + , status_flags_t flags = {}) const;
│ │ │ std::vector<torrent_status> get_torrent_status (
│ │ │ std::function<bool(torrent_status const&)> const& pred
│ │ │ , status_flags_t flags = {}) const;
│ │ │ -void refresh_torrent_status (std::vector<torrent_status>* ret
│ │ │ - , status_flags_t flags = {}) const;
│ │ │
│ │ │
│ │ │
Note
│ │ │
these calls are potentially expensive and won't scale well with
│ │ │ lots of torrents. If you're concerned about performance, consider
│ │ │ using post_torrent_updates() instead.
│ │ │
│ │ │ @@ -507,41 +507,41 @@
│ │ │
│ │ │ void set_dht_state (dht::dht_state&& st);
│ │ │ void set_dht_state (dht::dht_state const& st);
│ │ │
│ │ │
set the DHT state for the session. This will be taken into account the
│ │ │ next time the DHT is started, as if it had been passed in via the
│ │ │ session_params on startup.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
find_torrent() get_torrents()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
get_torrents() find_torrent()
│ │ │
│ │ │ -std::vector<torrent_handle> get_torrents () const;
│ │ │ torrent_handle find_torrent (sha1_hash const& info_hash) const;
│ │ │ +std::vector<torrent_handle> get_torrents () const;
│ │ │
│ │ │
find_torrent() looks for a torrent with the given info-hash. In
│ │ │ case there is such a torrent in the session, a torrent_handle to that
│ │ │ torrent is returned. In case the torrent cannot be found, an invalid
│ │ │ torrent_handle is returned.
│ │ │
See torrent_handle::is_valid() to know if the torrent was found or
│ │ │ not.
│ │ │
get_torrents() returns a vector of torrent_handles to all the
│ │ │ torrents currently in the session.
│ │ │
│ │ │
[report issue]
│ │ │
│ │ │
async_add_torrent() add_torrent()
│ │ │
│ │ │ -torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);
│ │ │ -void async_add_torrent (add_torrent_params const& params);
│ │ │ void async_add_torrent (add_torrent_params&& params);
│ │ │ +torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);
│ │ │ torrent_handle add_torrent (add_torrent_params const& params);
│ │ │ +torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);
│ │ │ +void async_add_torrent (add_torrent_params const& params);
│ │ │ torrent_handle add_torrent (add_torrent_params&& params);
│ │ │ -torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);
│ │ │
│ │ │
You add torrents through the add_torrent() function where you give an
│ │ │ object with all the parameters. The add_torrent() overloads will block
│ │ │ until the torrent has been added (or failed to be added) and returns
│ │ │ an error code and a torrent_handle. In order to add torrents more
│ │ │ efficiently, consider using async_add_torrent() which returns
│ │ │ immediately, without waiting for the torrent to add. Notification of
│ │ │ @@ -566,19 +566,19 @@
│ │ │ want to control are torrent_flags::paused and
│ │ │ torrent_flags::auto_managed. In order to add a magnet link that will
│ │ │ just download the metadata, but no payload, set the
│ │ │ torrent_flags::upload_mode flag.
│ │ │
Special consideration has to be taken when adding hybrid torrents
│ │ │ (i.e. torrents that are BitTorrent v2 torrents that are backwards
│ │ │ compatible with v1). For more details, see BitTorrent v2 torrents.
│ │ │ -
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
pause() resume() is_paused()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
resume() is_paused() pause()
│ │ │
│ │ │ void pause ();
│ │ │ bool is_paused () const;
│ │ │ void resume ();
│ │ │
│ │ │
Pausing the session has the same effect as pausing every torrent in
│ │ │ it, except that torrents will not be resumed by the auto-manage
│ │ │ @@ -690,18 +690,18 @@
│ │ │ with the function object's context and make the function entirely
│ │ │ self-contained. The only reason data blob's value is computed
│ │ │ via a function instead of just passing in the new value is to avoid
│ │ │ race conditions. If you want to update the value in the DHT, you
│ │ │ must first retrieve it, then modify it, then write it back. The way
│ │ │ the DHT works, it is natural to always do a lookup before storing and
│ │ │ calling the callback in between is convenient.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_get_peers() dht_announce()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_announce() dht_get_peers()
│ │ │
│ │ │ void dht_get_peers (sha1_hash const& info_hash);
│ │ │ void dht_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});
│ │ │
│ │ │
dht_get_peers() will issue a DHT get_peer request to the DHT for the
│ │ │ specified info-hash. The response (the peers) will be posted back in a
│ │ │ dht_get_peers_reply_alert.
│ │ │ @@ -749,17 +749,17 @@
│ │ │ with the response (if any) and the userdata pointer passed in here.
│ │ │ Since this
alert is a response to an explicit call, it will always be
│ │ │ posted, regardless of the
alert mask.
│ │ │
[report issue]
│ │ │
│ │ │
add_extension()
│ │ │
│ │ │ -void add_extension (std::shared_ptr<plugin> ext);
│ │ │ void add_extension (std::function<std::shared_ptr<torrent_plugin>(
│ │ │ torrent_handle const&, client_data_t)> ext);
│ │ │ +void add_extension (std::shared_ptr<plugin> ext);
│ │ │
│ │ │
This function adds an extension to this session. The argument is a
│ │ │ function object that is called with a torrent_handle and which should
│ │ │ return a std::shared_ptr<torrent_plugin>. To write custom
│ │ │ plugins, see libtorrent plugins. For the typical bittorrent client
│ │ │ all of these extensions should be added. The main plugins implemented
│ │ │ in libtorrent are:
│ │ │ @@ -792,16 +792,16 @@
│ │ │
ses.add_extension(<::create_smart_ban_plugin);
│ │ │
│ │ │
│ │ │
[report issue]
│ │ │
│ │ │
set_ip_filter() get_ip_filter()
│ │ │
│ │ │ -ip_filter get_ip_filter () const;
│ │ │ void set_ip_filter (ip_filter f);
│ │ │ +ip_filter get_ip_filter () const;
│ │ │
│ │ │
Sets a filter that will be used to reject and accept incoming as well
│ │ │ as outgoing connections based on their originating ip address. The
│ │ │ default filter will allow connections to any ip address. To build a
│ │ │ set of rules for which addresses are accepted and not, see ip_filter.
│ │ │
Each time a peer is blocked because of the IP filter, a
│ │ │ peer_blocked_alert is generated. get_ip_filter() Returns the
│ │ │ @@ -818,17 +818,17 @@
│ │ │ anti-virus software by connecting to SMTP, FTP ports.
│ │ │
│ │ │
│ │ │
[report issue]
│ │ │
│ │ │
is_listening() ssl_listen_port() listen_port()
│ │ │
│ │ │ +unsigned short listen_port () const;
│ │ │ unsigned short ssl_listen_port () const;
│ │ │ bool is_listening () const;
│ │ │ -unsigned short listen_port () const;
│ │ │
│ │ │
is_listening() will tell you whether or not the session has
│ │ │ successfully opened a listening port. If it hasn't, this function will
│ │ │ return false, and then you can set a new
│ │ │ settings_pack::listen_interfaces to try another interface and port to
│ │ │ bind to.
│ │ │
listen_port() returns the port we ended up listening on.
│ │ │ @@ -862,21 +862,21 @@
│ │ │ 32 bits in the IP range mapping. Only the set bits matter; no peer
│ │ │ class will be removed from a peer as a result of this call, peer
│ │ │ classes are only added.
│ │ │
The peer_class argument cannot be greater than 31. The bitmasks
│ │ │ representing peer classes in the peer_class_filter are 32 bits.
│ │ │
The get_peer_class_filter() function returns the current filter.
│ │ │
For more information, see peer classes.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
get_peer_class_type_filter() set_peer_class_type_filter()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
set_peer_class_type_filter() get_peer_class_type_filter()
│ │ │
│ │ │ -void set_peer_class_type_filter (peer_class_type_filter const& f);
│ │ │ peer_class_type_filter get_peer_class_type_filter () const;
│ │ │ +void set_peer_class_type_filter (peer_class_type_filter const& f);
│ │ │
│ │ │
Sets and gets the peer class type filter. This is controls automatic
│ │ │ peer class assignments to peers based on what kind of socket it is.
│ │ │
It does not only support assigning peer classes, it also supports
│ │ │ removing peer classes based on socket type.
│ │ │
The order of these rules being applied are:
│ │ │
│ │ │ @@ -974,30 +974,30 @@
│ │ │ advised to remove them from the back of the queue, to minimize the
│ │ │ shifting.
│ │ │
│ │ │ [report issue]
│ │ │
│ │ │
apply_settings() get_settings()
│ │ │
│ │ │ +void apply_settings (settings_pack const&);
│ │ │ settings_pack get_settings () const;
│ │ │ void apply_settings (settings_pack&&);
│ │ │ -void apply_settings (settings_pack const&);
│ │ │
│ │ │
Applies the settings specified by the settings_pack s. This is an
│ │ │ asynchronous operation that will return immediately and actually apply
│ │ │ the settings to the main thread of libtorrent some time later.
│ │ │
│ │ │
│ │ │
[report issue]
│ │ │
│ │ │
set_alert_notify() wait_for_alert() pop_alerts()
│ │ │
│ │ │ -alert* wait_for_alert (time_duration max_wait);
│ │ │ void pop_alerts (std::vector<alert*>* alerts);
│ │ │ void set_alert_notify (std::function<void()> const& fun);
│ │ │ +alert* wait_for_alert (time_duration max_wait);
│ │ │
│ │ │
Alerts is the main mechanism for libtorrent to report errors and
│ │ │ events. pop_alerts fills in the vector passed to it with pointers
│ │ │ to new alerts. The session still owns these alerts and they will stay
│ │ │ valid until the next time pop_alerts is called. You may not delete
│ │ │ the alert objects.
│ │ │
It is safe to call pop_alerts from multiple different threads, as
│ │ │ @@ -1123,29 +1123,29 @@
│ │ │ [report issue]
│ │ │ - reopen_map_ports
│ │ │ - This option indicates if the ports are mapped using natpmp
│ │ │ and upnp. If mapping was already made, they are deleted and added
│ │ │ again. This only works if natpmp and/or upnp are configured to be
│ │ │ enable.
│ │ │
│ │ │ -
│ │ │
│ │ │ -
[report issue]
│ │ │ +
│ │ │ +
[report issue]
│ │ │
│ │ │ -
│ │ │ -
write_session_params_buf() write_session_params() read_session_params()
│ │ │ +
│ │ │ +
write_session_params() write_session_params_buf() read_session_params()
│ │ │
Declared in "libtorrent/session_params.hpp"
│ │ │
│ │ │ -session_params read_session_params (bdecode_node const& e
│ │ │ - , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ -entry write_session_params (session_params const& sp
│ │ │ +session_params read_session_params (span<char const> buf
│ │ │ , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ std::vector<char> write_session_params_buf (session_params const& sp
│ │ │ , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ -session_params read_session_params (span<char const> buf
│ │ │ +session_params read_session_params (bdecode_node const& e
│ │ │ + , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ +entry write_session_params (session_params const& sp
│ │ │ , save_state_flags_t flags = save_state_flags_t::all());
│ │ │
│ │ │
These functions serialize and de-serialize a session_params object to and
│ │ │ from bencoded form. The session_params object is used to initialize a new
│ │ │ session using the state from a previous one (or by programmatically configure
│ │ │ the session up-front).
│ │ │ The flags parameter can be used to only save and load certain aspects of the
│ │ │ ├── html2text {}
│ │ │ │ @@ -3,95 +3,95 @@
│ │ │ │ VVeerrssiioonn:: 2.0.11
│ │ │ │ _h_o_m_e
│ │ │ │ Table of contents
│ │ │ │ * _s_e_s_s_i_o_n___p_a_r_a_m_s
│ │ │ │ o _s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ o _s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ * _s_e_s_s_i_o_n___p_r_o_x_y
│ │ │ │ - o _~_s_e_s_s_i_o_n___p_r_o_x_y_(_)_ _o_p_e_r_a_t_o_r_=_(_)_ _s_e_s_s_i_o_n___p_r_o_x_y_(_)
│ │ │ │ + o _o_p_e_r_a_t_o_r_=_(_)_ _~_s_e_s_s_i_o_n___p_r_o_x_y_(_)_ _s_e_s_s_i_o_n___p_r_o_x_y_(_)
│ │ │ │ * _s_e_s_s_i_o_n
│ │ │ │ o _s_e_s_s_i_o_n_(_)
│ │ │ │ o _s_e_s_s_i_o_n_(_)
│ │ │ │ o _~_s_e_s_s_i_o_n_(_)
│ │ │ │ o _a_b_o_r_t_(_)
│ │ │ │ * _s_e_s_s_i_o_n___h_a_n_d_l_e
│ │ │ │ o _i_s___v_a_l_i_d_(_)
│ │ │ │ o _s_e_s_s_i_o_n___s_t_a_t_e_(_)
│ │ │ │ - o _g_e_t___t_o_r_r_e_n_t___s_t_a_t_u_s_(_)_ _r_e_f_r_e_s_h___t_o_r_r_e_n_t___s_t_a_t_u_s_(_)
│ │ │ │ + o _r_e_f_r_e_s_h___t_o_r_r_e_n_t___s_t_a_t_u_s_(_)_ _g_e_t___t_o_r_r_e_n_t___s_t_a_t_u_s_(_)
│ │ │ │ o _p_o_s_t___t_o_r_r_e_n_t___u_p_d_a_t_e_s_(_)
│ │ │ │ o _p_o_s_t___s_e_s_s_i_o_n___s_t_a_t_s_(_)
│ │ │ │ o _p_o_s_t___d_h_t___s_t_a_t_s_(_)
│ │ │ │ o _s_e_t___d_h_t___s_t_a_t_e_(_)
│ │ │ │ - o _f_i_n_d___t_o_r_r_e_n_t_(_)_ _g_e_t___t_o_r_r_e_n_t_s_(_)
│ │ │ │ + o _g_e_t___t_o_r_r_e_n_t_s_(_)_ _f_i_n_d___t_o_r_r_e_n_t_(_)
│ │ │ │ o _a_s_y_n_c___a_d_d___t_o_r_r_e_n_t_(_)_ _a_d_d___t_o_r_r_e_n_t_(_)
│ │ │ │ - o _p_a_u_s_e_(_)_ _r_e_s_u_m_e_(_)_ _i_s___p_a_u_s_e_d_(_)
│ │ │ │ + o _r_e_s_u_m_e_(_)_ _i_s___p_a_u_s_e_d_(_)_ _p_a_u_s_e_(_)
│ │ │ │ o _i_s___d_h_t___r_u_n_n_i_n_g_(_)
│ │ │ │ o _s_e_t___d_h_t___s_t_o_r_a_g_e_(_)
│ │ │ │ o _a_d_d___d_h_t___n_o_d_e_(_)
│ │ │ │ o _d_h_t___g_e_t___i_t_e_m_(_)
│ │ │ │ o _d_h_t___g_e_t___i_t_e_m_(_)
│ │ │ │ o _d_h_t___p_u_t___i_t_e_m_(_)
│ │ │ │ o _d_h_t___p_u_t___i_t_e_m_(_)
│ │ │ │ - o _d_h_t___g_e_t___p_e_e_r_s_(_)_ _d_h_t___a_n_n_o_u_n_c_e_(_)
│ │ │ │ + o _d_h_t___a_n_n_o_u_n_c_e_(_)_ _d_h_t___g_e_t___p_e_e_r_s_(_)
│ │ │ │ o _d_h_t___l_i_v_e___n_o_d_e_s_(_)
│ │ │ │ o _d_h_t___s_a_m_p_l_e___i_n_f_o_h_a_s_h_e_s_(_)
│ │ │ │ o _d_h_t___d_i_r_e_c_t___r_e_q_u_e_s_t_(_)
│ │ │ │ o _a_d_d___e_x_t_e_n_s_i_o_n_(_)
│ │ │ │ o _s_e_t___i_p___f_i_l_t_e_r_(_)_ _g_e_t___i_p___f_i_l_t_e_r_(_)
│ │ │ │ o _s_e_t___p_o_r_t___f_i_l_t_e_r_(_)
│ │ │ │ o _i_s___l_i_s_t_e_n_i_n_g_(_)_ _s_s_l___l_i_s_t_e_n___p_o_r_t_(_)_ _l_i_s_t_e_n___p_o_r_t_(_)
│ │ │ │ o _s_e_t___p_e_e_r___c_l_a_s_s___f_i_l_t_e_r_(_)_ _g_e_t___p_e_e_r___c_l_a_s_s___f_i_l_t_e_r_(_)
│ │ │ │ - o _g_e_t___p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r_(_)_ _s_e_t___p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r_(_)
│ │ │ │ + o _s_e_t___p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r_(_)_ _g_e_t___p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r_(_)
│ │ │ │ o _c_r_e_a_t_e___p_e_e_r___c_l_a_s_s_(_)
│ │ │ │ o _d_e_l_e_t_e___p_e_e_r___c_l_a_s_s_(_)
│ │ │ │ o _g_e_t___p_e_e_r___c_l_a_s_s_(_)_ _s_e_t___p_e_e_r___c_l_a_s_s_(_)
│ │ │ │ o _r_e_m_o_v_e___t_o_r_r_e_n_t_(_)
│ │ │ │ o _a_p_p_l_y___s_e_t_t_i_n_g_s_(_)_ _g_e_t___s_e_t_t_i_n_g_s_(_)
│ │ │ │ o _s_e_t___a_l_e_r_t___n_o_t_i_f_y_(_)_ _w_a_i_t___f_o_r___a_l_e_r_t_(_)_ _p_o_p___a_l_e_r_t_s_(_)
│ │ │ │ o _d_e_l_e_t_e___p_o_r_t___m_a_p_p_i_n_g_(_)_ _a_d_d___p_o_r_t___m_a_p_p_i_n_g_(_)
│ │ │ │ o _r_e_o_p_e_n___n_e_t_w_o_r_k___s_o_c_k_e_t_s_(_)
│ │ │ │ o _n_a_t_i_v_e___h_a_n_d_l_e_(_)
│ │ │ │ - * _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s___b_u_f_(_)_ _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)_ _r_e_a_d___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ + * _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)_ _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s___b_u_f_(_)_ _r_e_a_d___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ sseessssiioonn__ppaarraammss ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___p_a_r_a_m_s_._h_p_p"
│ │ │ │ The _s_e_s_s_i_o_n___p_a_r_a_m_s is a parameters pack for configuring the _s_e_s_s_i_o_n before it's
│ │ │ │ started.
│ │ │ │ struct session_params
│ │ │ │ {
│ │ │ │ - sseessssiioonn__ppaarraammss ();
│ │ │ │ sseessssiioonn__ppaarraammss (settings_pack const& sp);
│ │ │ │ sseessssiioonn__ppaarraammss (settings_pack&& sp);
│ │ │ │ - sseessssiioonn__ppaarraammss (settings_pack&& sp
│ │ │ │ - , std::vector> exts);
│ │ │ │ + sseessssiioonn__ppaarraammss ();
│ │ │ │ sseessssiioonn__ppaarraammss (settings_pack const& sp
│ │ │ │ , std::vector> exts);
│ │ │ │ + sseessssiioonn__ppaarraammss (settings_pack&& sp
│ │ │ │ + , std::vector> exts);
│ │ │ │
│ │ │ │ settings_pack settings;
│ │ │ │ std::vector> extensions;
│ │ │ │ dht::dht_state dht_state;
│ │ │ │ dht::dht_storage_constructor_type dht_storage_constructor;
│ │ │ │ disk_io_constructor_type disk_io_constructor;
│ │ │ │ std::map ext_state;
│ │ │ │ libtorrent::ip_filter ip_filter;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** sseessssiioonn__ppaarraammss(()) **********
│ │ │ │ -sseessssiioonn__ppaarraammss ();
│ │ │ │ sseessssiioonn__ppaarraammss (settings_pack const& sp);
│ │ │ │ sseessssiioonn__ppaarraammss (settings_pack&& sp);
│ │ │ │ +sseessssiioonn__ppaarraammss ();
│ │ │ │ This constructor can be used to start with the default plugins (ut_metadata,
│ │ │ │ ut_pex and smart_ban). Pass a _s_e_t_t_i_n_g_s___p_a_c_k to set the initial settings when
│ │ │ │ the _s_e_s_s_i_o_n starts.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** sseessssiioonn__ppaarraammss(()) **********
│ │ │ │ -sseessssiioonn__ppaarraammss (settings_pack&& sp
│ │ │ │ - , std::vector> exts);
│ │ │ │ sseessssiioonn__ppaarraammss (settings_pack const& sp
│ │ │ │ , std::vector> exts);
│ │ │ │ +sseessssiioonn__ppaarraammss (settings_pack&& sp
│ │ │ │ + , std::vector> exts);
│ │ │ │ This constructor helps to configure the set of initial plugins to be added to
│ │ │ │ the _s_e_s_s_i_o_n before it's started.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ settings
│ │ │ │ The settings to configure the _s_e_s_s_i_o_n with
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ extensions
│ │ │ │ @@ -122,29 +122,29 @@
│ │ │ │ _s_e_s_s_i_o_n destruction is explicitly initiated, this holder is used to synchronize
│ │ │ │ the completion of the shutdown. The lifetime of this object may outlive
│ │ │ │ _s_e_s_s_i_o_n, causing the _s_e_s_s_i_o_n destructor to not block. The _s_e_s_s_i_o_n___p_r_o_x_y
│ │ │ │ destructor will block however, until the underlying _s_e_s_s_i_o_n is done shutting
│ │ │ │ down.
│ │ │ │ struct session_proxy
│ │ │ │ {
│ │ │ │ - sseessssiioonn__pprrooxxyy (session_proxy const&);
│ │ │ │ - session_proxy& ooppeerraattoorr== (session_proxy&&) & noexcept;
│ │ │ │ - session_proxy& ooppeerraattoorr== (session_proxy const&) &;
│ │ │ │ sseessssiioonn__pprrooxxyy (session_proxy&&) noexcept;
│ │ │ │ - ~~sseessssiioonn__pprrooxxyy ();
│ │ │ │ + sseessssiioonn__pprrooxxyy (session_proxy const&);
│ │ │ │ sseessssiioonn__pprrooxxyy ();
│ │ │ │ + ~~sseessssiioonn__pprrooxxyy ();
│ │ │ │ + session_proxy& ooppeerraattoorr== (session_proxy const&) &;
│ │ │ │ + session_proxy& ooppeerraattoorr== (session_proxy&&) & noexcept;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ~~sseessssiioonn__pprrooxxyy(()) ooppeerraattoorr==(()) sseessssiioonn__pprrooxxyy(()) **********
│ │ │ │ -sseessssiioonn__pprrooxxyy (session_proxy const&);
│ │ │ │ -session_proxy& ooppeerraattoorr== (session_proxy&&) & noexcept;
│ │ │ │ -session_proxy& ooppeerraattoorr== (session_proxy const&) &;
│ │ │ │ +********** ooppeerraattoorr==(()) ~~sseessssiioonn__pprrooxxyy(()) sseessssiioonn__pprrooxxyy(()) **********
│ │ │ │ sseessssiioonn__pprrooxxyy (session_proxy&&) noexcept;
│ │ │ │ -~~sseessssiioonn__pprrooxxyy ();
│ │ │ │ +sseessssiioonn__pprrooxxyy (session_proxy const&);
│ │ │ │ sseessssiioonn__pprrooxxyy ();
│ │ │ │ +~~sseessssiioonn__pprrooxxyy ();
│ │ │ │ +session_proxy& ooppeerraattoorr== (session_proxy const&) &;
│ │ │ │ +session_proxy& ooppeerraattoorr== (session_proxy&&) & noexcept;
│ │ │ │ default constructor, does not refer to any _s_e_s_s_i_o_n implementation object.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ sseessssiioonn ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n_._h_p_p"
│ │ │ │ The _s_e_s_s_i_o_n holds all state that spans multiple torrents. Among other things it
│ │ │ │ runs the network loop and manages all torrents. Once it's created, the _s_e_s_s_i_o_n
│ │ │ │ object will spawn the main thread that will do all the work. The main thread
│ │ │ │ @@ -152,47 +152,47 @@
│ │ │ │ You have some control over _s_e_s_s_i_o_n configuration through the session_handle::
│ │ │ │ apply_settings() member function. To change one or more configuration options,
│ │ │ │ create a _s_e_t_t_i_n_g_s___p_a_c_k. object and fill it with the settings to be set and pass
│ │ │ │ it in to session::apply_settings().
│ │ │ │ see _a_p_p_l_y___s_e_t_t_i_n_g_s_(_).
│ │ │ │ struct session : session_handle
│ │ │ │ {
│ │ │ │ - sseessssiioonn (session_params const& params, session_flags_t flags);
│ │ │ │ sseessssiioonn (session_params&& params, session_flags_t flags);
│ │ │ │ - explicit sseessssiioonn (session_params&& params);
│ │ │ │ sseessssiioonn ();
│ │ │ │ explicit sseessssiioonn (session_params const& params);
│ │ │ │ - sseessssiioonn (session_params&& params, io_context& ios);
│ │ │ │ + sseessssiioonn (session_params const& params, session_flags_t flags);
│ │ │ │ + explicit sseessssiioonn (session_params&& params);
│ │ │ │ + sseessssiioonn (session_params const& params, io_context& ios);
│ │ │ │ sseessssiioonn (session_params const& params, io_context& ios, session_flags_t);
│ │ │ │ + sseessssiioonn (session_params&& params, io_context& ios);
│ │ │ │ sseessssiioonn (session_params&& params, io_context& ios, session_flags_t);
│ │ │ │ - sseessssiioonn (session_params const& params, io_context& ios);
│ │ │ │ ~~sseessssiioonn ();
│ │ │ │ session_proxy aabboorrtt ();
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** sseessssiioonn(()) **********
│ │ │ │ -sseessssiioonn (session_params const& params, session_flags_t flags);
│ │ │ │ sseessssiioonn (session_params&& params, session_flags_t flags);
│ │ │ │ -explicit sseessssiioonn (session_params&& params);
│ │ │ │ sseessssiioonn ();
│ │ │ │ explicit sseessssiioonn (session_params const& params);
│ │ │ │ +sseessssiioonn (session_params const& params, session_flags_t flags);
│ │ │ │ +explicit sseessssiioonn (session_params&& params);
│ │ │ │ Constructs the _s_e_s_s_i_o_n objects which acts as the container of torrents. In
│ │ │ │ order to avoid a race condition between starting the _s_e_s_s_i_o_n and configuring
│ │ │ │ it, you can pass in a _s_e_s_s_i_o_n___p_a_r_a_m_s object. Its settings will take effect
│ │ │ │ before the _s_e_s_s_i_o_n starts up.
│ │ │ │ The overloads taking flags can be used to start a _s_e_s_s_i_o_n in paused mode (by
│ │ │ │ passing in session::paused). Note that add_default_plugins do not have an
│ │ │ │ affect on constructors that take a _s_e_s_s_i_o_n___p_a_r_a_m_s object. It already contains
│ │ │ │ the plugins to use.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** sseessssiioonn(()) **********
│ │ │ │ -sseessssiioonn (session_params&& params, io_context& ios);
│ │ │ │ +sseessssiioonn (session_params const& params, io_context& ios);
│ │ │ │ sseessssiioonn (session_params const& params, io_context& ios, session_flags_t);
│ │ │ │ +sseessssiioonn (session_params&& params, io_context& ios);
│ │ │ │ sseessssiioonn (session_params&& params, io_context& ios, session_flags_t);
│ │ │ │ -sseessssiioonn (session_params const& params, io_context& ios);
│ │ │ │ Overload of the constructor that takes an external io_context to run the
│ │ │ │ _s_e_s_s_i_o_n object on. This is primarily useful for tests that may want to run
│ │ │ │ multiple sessions on a single io_context, or low resource systems where
│ │ │ │ additional threads are expensive and sharing an io_context with other events is
│ │ │ │ fine.
│ │ │ │ Warning
│ │ │ │ The _s_e_s_s_i_o_n object does not cleanly terminate with an external io_context. The
│ │ │ │ @@ -232,33 +232,33 @@
│ │ │ │ operation on it will throw a system_error exception, with error code
│ │ │ │ invalid_session_handle.
│ │ │ │ struct session_handle
│ │ │ │ {
│ │ │ │ bool iiss__vvaalliidd () const;
│ │ │ │ session_params sseessssiioonn__ssttaattee (save_state_flags_t flags =
│ │ │ │ save_state_flags_t::all()) const;
│ │ │ │ + void rreeffrreesshh__ttoorrrreenntt__ssttaattuuss (std::vector* ret
│ │ │ │ + , status_flags_t flags = {}) const;
│ │ │ │ std::vector ggeett__ttoorrrreenntt__ssttaattuuss (
│ │ │ │ std::function const& pred
│ │ │ │ , status_flags_t flags = {}) const;
│ │ │ │ - void rreeffrreesshh__ttoorrrreenntt__ssttaattuuss (std::vector* ret
│ │ │ │ - , status_flags_t flags = {}) const;
│ │ │ │ void ppoosstt__ttoorrrreenntt__uuppddaatteess (status_flags_t flags = status_flags_t::all());
│ │ │ │ void ppoosstt__sseessssiioonn__ssttaattss ();
│ │ │ │ void ppoosstt__ddhhtt__ssttaattss ();
│ │ │ │ void sseett__ddhhtt__ssttaattee (dht::dht_state&& st);
│ │ │ │ void sseett__ddhhtt__ssttaattee (dht::dht_state const& st);
│ │ │ │ - std::vector ggeett__ttoorrrreennttss () const;
│ │ │ │ torrent_handle ffiinndd__ttoorrrreenntt (sha1_hash const& info_hash) const;
│ │ │ │ - torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params, error_code& ec);
│ │ │ │ - void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params const& params);
│ │ │ │ + std::vector ggeett__ttoorrrreennttss () const;
│ │ │ │ void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params&& params);
│ │ │ │ - torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params);
│ │ │ │ - torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params);
│ │ │ │ torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params, error_code&
│ │ │ │ ec);
│ │ │ │ + torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params);
│ │ │ │ + torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params, error_code& ec);
│ │ │ │ + void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params const& params);
│ │ │ │ + torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params);
│ │ │ │ void ppaauussee ();
│ │ │ │ bool iiss__ppaauusseedd () const;
│ │ │ │ void rreessuummee ();
│ │ │ │ bool iiss__ddhhtt__rruunnnniinngg () const;
│ │ │ │ void sseett__ddhhtt__ssttoorraaggee (dht::dht_storage_constructor_type sc);
│ │ │ │ void aadddd__ddhhtt__nnooddee (std::pair const& node);
│ │ │ │ void ddhhtt__ggeett__iitteemm (sha1_hash const& target);
│ │ │ │ @@ -273,38 +273,38 @@
│ │ │ │ void ddhhtt__aannnnoouunnccee (sha1_hash const& info_hash, int port = 0, dht::
│ │ │ │ announce_flags_t flags = {});
│ │ │ │ void ddhhtt__lliivvee__nnooddeess (sha1_hash const& nid);
│ │ │ │ void ddhhtt__ssaammppllee__iinnffoohhaasshheess (udp::endpoint const& ep, sha1_hash const&
│ │ │ │ target);
│ │ │ │ void ddhhtt__ddiirreecctt__rreeqquueesstt (udp::endpoint const& ep, entry const& e,
│ │ │ │ client_data_t userdata = {});
│ │ │ │ - void aadddd__eexxtteennssiioonn (std::shared_ptr ext);
│ │ │ │ void aadddd__eexxtteennssiioonn (std::function(
│ │ │ │ torrent_handle const&, client_data_t)> ext);
│ │ │ │ - ip_filter ggeett__iipp__ffiilltteerr () const;
│ │ │ │ + void aadddd__eexxtteennssiioonn (std::shared_ptr ext);
│ │ │ │ void sseett__iipp__ffiilltteerr (ip_filter f);
│ │ │ │ + ip_filter ggeett__iipp__ffiilltteerr () const;
│ │ │ │ void sseett__ppoorrtt__ffiilltteerr (port_filter const& f);
│ │ │ │ + unsigned short lliisstteenn__ppoorrtt () const;
│ │ │ │ unsigned short ssssll__lliisstteenn__ppoorrtt () const;
│ │ │ │ bool iiss__lliisstteenniinngg () const;
│ │ │ │ - unsigned short lliisstteenn__ppoorrtt () const;
│ │ │ │ ip_filter ggeett__ppeeeerr__ccllaassss__ffiilltteerr () const;
│ │ │ │ void sseett__ppeeeerr__ccllaassss__ffiilltteerr (ip_filter const& f);
│ │ │ │ - void sseett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr (peer_class_type_filter const& f);
│ │ │ │ peer_class_type_filter ggeett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr () const;
│ │ │ │ + void sseett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr (peer_class_type_filter const& f);
│ │ │ │ peer_class_t ccrreeaattee__ppeeeerr__ccllaassss (char const* name);
│ │ │ │ void ddeelleettee__ppeeeerr__ccllaassss (peer_class_t cid);
│ │ │ │ void sseett__ppeeeerr__ccllaassss (peer_class_t cid, peer_class_info const& pci);
│ │ │ │ peer_class_info ggeett__ppeeeerr__ccllaassss (peer_class_t cid) const;
│ │ │ │ void rreemmoovvee__ttoorrrreenntt (const torrent_handle&, remove_flags_t = {});
│ │ │ │ + void aappppllyy__sseettttiinnggss (settings_pack const&);
│ │ │ │ settings_pack ggeett__sseettttiinnggss () const;
│ │ │ │ void aappppllyy__sseettttiinnggss (settings_pack&&);
│ │ │ │ - void aappppllyy__sseettttiinnggss (settings_pack const&);
│ │ │ │ - alert* wwaaiitt__ffoorr__aalleerrtt (time_duration max_wait);
│ │ │ │ void ppoopp__aalleerrttss (std::vector* alerts);
│ │ │ │ void sseett__aalleerrtt__nnoottiiffyy (std::function const& fun);
│ │ │ │ + alert* wwaaiitt__ffoorr__aalleerrtt (time_duration max_wait);
│ │ │ │ void ddeelleettee__ppoorrtt__mmaappppiinngg (port_mapping_t handle);
│ │ │ │ std::vector aadddd__ppoorrtt__mmaappppiinngg (portmap_protocol t, int
│ │ │ │ external_port, int local_port);
│ │ │ │ void rreeooppeenn__nneettwwoorrkk__ssoocckkeettss (reopen_network_flags_t options =
│ │ │ │ reopen_map_ports);
│ │ │ │ std::shared_ptr nnaattiivvee__hhaannddllee () const;
│ │ │ │
│ │ │ │ @@ -333,20 +333,20 @@
│ │ │ │ all()) const;
│ │ │ │ returns the current _s_e_s_s_i_o_n state. This can be passed to _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ to save the state to disk and restored using _r_e_a_d___s_e_s_s_i_o_n___p_a_r_a_m_s_(_) when
│ │ │ │ constructing a new _s_e_s_s_i_o_n. The kind of state that's included is all settings,
│ │ │ │ the DHT routing table, possibly plugin-specific state. the flags parameter can
│ │ │ │ be used to only save certain parts of the _s_e_s_s_i_o_n state
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ggeett__ttoorrrreenntt__ssttaattuuss(()) rreeffrreesshh__ttoorrrreenntt__ssttaattuuss(()) **********
│ │ │ │ +********** rreeffrreesshh__ttoorrrreenntt__ssttaattuuss(()) ggeett__ttoorrrreenntt__ssttaattuuss(()) **********
│ │ │ │ +void rreeffrreesshh__ttoorrrreenntt__ssttaattuuss (std::vector* ret
│ │ │ │ + , status_flags_t flags = {}) const;
│ │ │ │ std::vector ggeett__ttoorrrreenntt__ssttaattuuss (
│ │ │ │ std::function const& pred
│ │ │ │ , status_flags_t flags = {}) const;
│ │ │ │ -void rreeffrreesshh__ttoorrrreenntt__ssttaattuuss (std::vector* ret
│ │ │ │ - , status_flags_t flags = {}) const;
│ │ │ │ Note
│ │ │ │ these calls are potentially expensive and won't scale well with lots of
│ │ │ │ torrents. If you're concerned about performance, consider using
│ │ │ │ post_torrent_updates() instead.
│ │ │ │ get_torrent_status returns a vector of the _t_o_r_r_e_n_t___s_t_a_t_u_s for every torrent
│ │ │ │ which satisfies pred, which is a predicate function which determines if a
│ │ │ │ torrent should be included in the returned set or not. Returning true means it
│ │ │ │ @@ -397,31 +397,31 @@
│ │ │ │ ********** sseett__ddhhtt__ssttaattee(()) **********
│ │ │ │ void sseett__ddhhtt__ssttaattee (dht::dht_state&& st);
│ │ │ │ void sseett__ddhhtt__ssttaattee (dht::dht_state const& st);
│ │ │ │ set the DHT state for the _s_e_s_s_i_o_n. This will be taken into account the next
│ │ │ │ time the DHT is started, as if it had been passed in via the _s_e_s_s_i_o_n___p_a_r_a_m_s on
│ │ │ │ startup.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiinndd__ttoorrrreenntt(()) ggeett__ttoorrrreennttss(()) **********
│ │ │ │ -std::vector ggeett__ttoorrrreennttss () const;
│ │ │ │ +********** ggeett__ttoorrrreennttss(()) ffiinndd__ttoorrrreenntt(()) **********
│ │ │ │ torrent_handle ffiinndd__ttoorrrreenntt (sha1_hash const& info_hash) const;
│ │ │ │ +std::vector ggeett__ttoorrrreennttss () const;
│ │ │ │ find_torrent() looks for a torrent with the given info-hash. In case there is
│ │ │ │ such a torrent in the _s_e_s_s_i_o_n, a _t_o_r_r_e_n_t___h_a_n_d_l_e to that torrent is returned. In
│ │ │ │ case the torrent cannot be found, an invalid _t_o_r_r_e_n_t___h_a_n_d_l_e is returned.
│ │ │ │ See torrent_handle::is_valid() to know if the torrent was found or not.
│ │ │ │ get_torrents() returns a vector of torrent_handles to all the torrents
│ │ │ │ currently in the _s_e_s_s_i_o_n.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** aassyynncc__aadddd__ttoorrrreenntt(()) aadddd__ttoorrrreenntt(()) **********
│ │ │ │ -torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params, error_code& ec);
│ │ │ │ -void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params const& params);
│ │ │ │ void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params&& params);
│ │ │ │ +torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params, error_code& ec);
│ │ │ │ torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params);
│ │ │ │ +torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params, error_code& ec);
│ │ │ │ +void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params const& params);
│ │ │ │ torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params);
│ │ │ │ -torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params, error_code& ec);
│ │ │ │ You add torrents through the _a_d_d___t_o_r_r_e_n_t_(_) function where you give an object
│ │ │ │ with all the parameters. The _a_d_d___t_o_r_r_e_n_t_(_) overloads will block until the
│ │ │ │ torrent has been added (or failed to be added) and returns an error code and a
│ │ │ │ _t_o_r_r_e_n_t___h_a_n_d_l_e. In order to add torrents more efficiently, consider using
│ │ │ │ _a_s_y_n_c___a_d_d___t_o_r_r_e_n_t_(_) which returns immediately, without waiting for the torrent
│ │ │ │ to add. Notification of the torrent being added is sent as _a_d_d___t_o_r_r_e_n_t___a_l_e_r_t.
│ │ │ │ The save_path field in _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s must be set to a valid path where the
│ │ │ │ @@ -442,15 +442,15 @@
│ │ │ │ torrent_flags::paused and torrent_flags::auto_managed. In order to add a magnet
│ │ │ │ link that will just download the metadata, but no payload, set the
│ │ │ │ torrent_flags::upload_mode flag.
│ │ │ │ Special consideration has to be taken when adding hybrid torrents (i.e.
│ │ │ │ torrents that are BitTorrent v2 torrents that are backwards compatible with
│ │ │ │ v1). For more details, see _B_i_t_T_o_r_r_e_n_t_ _v_2_ _t_o_r_r_e_n_t_s.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppaauussee(()) rreessuummee(()) iiss__ppaauusseedd(()) **********
│ │ │ │ +********** rreessuummee(()) iiss__ppaauusseedd(()) ppaauussee(()) **********
│ │ │ │ void ppaauussee ();
│ │ │ │ bool iiss__ppaauusseedd () const;
│ │ │ │ void rreessuummee ();
│ │ │ │ Pausing the _s_e_s_s_i_o_n has the same effect as pausing every torrent in it, except
│ │ │ │ that torrents will not be resumed by the auto-manage mechanism. Resuming will
│ │ │ │ restore the torrents to their previous paused state. i.e. the _s_e_s_s_i_o_n pause
│ │ │ │ state is separate from the torrent pause state. A torrent is inactive if it is
│ │ │ │ @@ -529,15 +529,15 @@
│ │ │ │ and make the function entirely self-contained. The only reason data blob's
│ │ │ │ value is computed via a function instead of just passing in the new value is to
│ │ │ │ avoid race conditions. If you want to uuppddaattee the value in the DHT, you must
│ │ │ │ first retrieve it, then modify it, then write it back. The way the DHT works,
│ │ │ │ it is natural to always do a lookup before storing and calling the callback in
│ │ │ │ between is convenient.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddhhtt__ggeett__ppeeeerrss(()) ddhhtt__aannnnoouunnccee(()) **********
│ │ │ │ +********** ddhhtt__aannnnoouunnccee(()) ddhhtt__ggeett__ppeeeerrss(()) **********
│ │ │ │ void ddhhtt__ggeett__ppeeeerrss (sha1_hash const& info_hash);
│ │ │ │ void ddhhtt__aannnnoouunnccee (sha1_hash const& info_hash, int port = 0, dht::
│ │ │ │ announce_flags_t flags = {});
│ │ │ │ dht_get_peers() will issue a DHT get_peer request to the DHT for the specified
│ │ │ │ info-hash. The response (the peers) will be posted back in a
│ │ │ │ _d_h_t___g_e_t___p_e_e_r_s___r_e_p_l_y___a_l_e_r_t.
│ │ │ │ dht_announce() will issue a DHT announce request to the DHT to the specified
│ │ │ │ @@ -572,17 +572,17 @@
│ │ │ │ Send an arbitrary DHT request directly to the specified endpoint. This function
│ │ │ │ is intended for use by plugins. When a response is received or the request
│ │ │ │ times out, a _d_h_t___d_i_r_e_c_t___r_e_s_p_o_n_s_e___a_l_e_r_t will be posted with the response (if
│ │ │ │ any) and the userdata pointer passed in here. Since this _a_l_e_r_t is a response to
│ │ │ │ an explicit call, it will always be posted, regardless of the _a_l_e_r_t mask.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** aadddd__eexxtteennssiioonn(()) **********
│ │ │ │ -void aadddd__eexxtteennssiioonn (std::shared_ptr ext);
│ │ │ │ void aadddd__eexxtteennssiioonn (std::function(
│ │ │ │ torrent_handle const&, client_data_t)> ext);
│ │ │ │ +void aadddd__eexxtteennssiioonn (std::shared_ptr ext);
│ │ │ │ This function adds an extension to this _s_e_s_s_i_o_n. The argument is a function
│ │ │ │ object that is called with a torrent_handle and which should return a std::
│ │ │ │ shared_ptr. To write custom plugins, see _l_i_b_t_o_r_r_e_n_t_ _p_l_u_g_i_n_s.
│ │ │ │ For the typical bittorrent client all of these extensions should be added. The
│ │ │ │ main plugins implemented in libtorrent are:
│ │ │ │ uTorrent metadata
│ │ │ │ Allows peers to download the metadata (.torrent files) from the swarm
│ │ │ │ @@ -598,16 +598,16 @@
│ │ │ │ A _p_l_u_g_i_n that, with a small overhead, can ban peers that sends bad data
│ │ │ │ with very high accuracy. Should eliminate most problems on poisoned
│ │ │ │ torrents.
│ │ │ │ #include
│ │ │ │ ses.add_extension(<::create_smart_ban_plugin);
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** sseett__iipp__ffiilltteerr(()) ggeett__iipp__ffiilltteerr(()) **********
│ │ │ │ -ip_filter ggeett__iipp__ffiilltteerr () const;
│ │ │ │ void sseett__iipp__ffiilltteerr (ip_filter f);
│ │ │ │ +ip_filter ggeett__iipp__ffiilltteerr () const;
│ │ │ │ Sets a filter that will be used to reject and accept incoming as well as
│ │ │ │ outgoing connections based on their originating ip address. The default filter
│ │ │ │ will allow connections to any ip address. To build a set of rules for which
│ │ │ │ addresses are accepted and not, see _i_p___f_i_l_t_e_r.
│ │ │ │ Each time a peer is blocked because of the IP filter, a _p_e_e_r___b_l_o_c_k_e_d___a_l_e_r_t is
│ │ │ │ generated. get_ip_filter() Returns the _i_p___f_i_l_t_e_r currently in the _s_e_s_s_i_o_n. See
│ │ │ │ _i_p___f_i_l_t_e_r.
│ │ │ │ @@ -616,17 +616,17 @@
│ │ │ │ void sseett__ppoorrtt__ffiilltteerr (port_filter const& f);
│ │ │ │ apply _p_o_r_t___f_i_l_t_e_r f to incoming and outgoing peers. a port filter will reject
│ │ │ │ making outgoing peer connections to certain remote ports. The main intention is
│ │ │ │ to be able to avoid triggering certain anti-virus software by connecting to
│ │ │ │ SMTP, FTP ports.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** iiss__lliisstteenniinngg(()) ssssll__lliisstteenn__ppoorrtt(()) lliisstteenn__ppoorrtt(()) **********
│ │ │ │ +unsigned short lliisstteenn__ppoorrtt () const;
│ │ │ │ unsigned short ssssll__lliisstteenn__ppoorrtt () const;
│ │ │ │ bool iiss__lliisstteenniinngg () const;
│ │ │ │ -unsigned short lliisstteenn__ppoorrtt () const;
│ │ │ │ is_listening() will tell you whether or not the _s_e_s_s_i_o_n has successfully opened
│ │ │ │ a listening port. If it hasn't, this function will return false, and then you
│ │ │ │ can set a new _s_e_t_t_i_n_g_s___p_a_c_k_:_:_l_i_s_t_e_n___i_n_t_e_r_f_a_c_e_s to try another interface and
│ │ │ │ port to bind to.
│ │ │ │ listen_port() returns the port we ended up listening on.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** sseett__ppeeeerr__ccllaassss__ffiilltteerr(()) ggeett__ppeeeerr__ccllaassss__ffiilltteerr(()) **********
│ │ │ │ @@ -652,17 +652,17 @@
│ │ │ │ in the IP range mapping. Only the set bits matter; no peer class will be
│ │ │ │ removed from a peer as a result of this call, peer classes are only added.
│ │ │ │ The peer_class argument cannot be greater than 31. The bitmasks representing
│ │ │ │ peer classes in the peer_class_filter are 32 bits.
│ │ │ │ The get_peer_class_filter() function returns the current filter.
│ │ │ │ For more information, see _p_e_e_r_ _c_l_a_s_s_e_s.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ggeett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr(()) sseett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr(()) **********
│ │ │ │ -void sseett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr (peer_class_type_filter const& f);
│ │ │ │ +********** sseett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr(()) ggeett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr(()) **********
│ │ │ │ peer_class_type_filter ggeett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr () const;
│ │ │ │ +void sseett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr (peer_class_type_filter const& f);
│ │ │ │ Sets and gets the ppeeeerr ccllaassss ttyyppee ffiilltteerr. This is controls automatic peer class
│ │ │ │ assignments to peers based on what kind of socket it is.
│ │ │ │ It does not only support assigning peer classes, it also supports removing peer
│ │ │ │ classes based on socket type.
│ │ │ │ The order of these rules being applied are:
│ │ │ │ 1. peer-class IP filter
│ │ │ │ 2. peer-class type filter, removing classes
│ │ │ │ @@ -731,25 +731,25 @@
│ │ │ │ Note that when a queued or downloading torrent is removed, its position in the
│ │ │ │ download queue is vacated and every subsequent torrent in the queue has their
│ │ │ │ queue positions updated. This can potentially cause a large state_update to be
│ │ │ │ posted. When removing all torrents, it is advised to remove them from the back
│ │ │ │ of the queue, to minimize the shifting.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** aappppllyy__sseettttiinnggss(()) ggeett__sseettttiinnggss(()) **********
│ │ │ │ +void aappppllyy__sseettttiinnggss (settings_pack const&);
│ │ │ │ settings_pack ggeett__sseettttiinnggss () const;
│ │ │ │ void aappppllyy__sseettttiinnggss (settings_pack&&);
│ │ │ │ -void aappppllyy__sseettttiinnggss (settings_pack const&);
│ │ │ │ Applies the settings specified by the _s_e_t_t_i_n_g_s___p_a_c_k s. This is an asynchronous
│ │ │ │ operation that will return immediately and actually apply the settings to the
│ │ │ │ main thread of libtorrent some time later.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** sseett__aalleerrtt__nnoottiiffyy(()) wwaaiitt__ffoorr__aalleerrtt(()) ppoopp__aalleerrttss(()) **********
│ │ │ │ -alert* wwaaiitt__ffoorr__aalleerrtt (time_duration max_wait);
│ │ │ │ void ppoopp__aalleerrttss (std::vector* alerts);
│ │ │ │ void sseett__aalleerrtt__nnoottiiffyy (std::function const& fun);
│ │ │ │ +alert* wwaaiitt__ffoorr__aalleerrtt (time_duration max_wait);
│ │ │ │ Alerts is the main mechanism for libtorrent to report errors and events.
│ │ │ │ pop_alerts fills in the vector passed to it with pointers to new alerts. The
│ │ │ │ _s_e_s_s_i_o_n still owns these alerts and they will stay valid until the next time
│ │ │ │ pop_alerts is called. You may not delete the _a_l_e_r_t objects.
│ │ │ │ It is safe to call pop_alerts from multiple different threads, as long as the
│ │ │ │ alerts themselves are not accessed once another thread calls pop_alerts. Doing
│ │ │ │ this requires manual synchronization between the popping threads.
│ │ │ │ @@ -845,24 +845,24 @@
│ │ │ │ protocols used by _a_d_d___p_o_r_t___m_a_p_p_i_n_g_(_)
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ reopen_map_ports
│ │ │ │ This option indicates if the ports are mapped using natpmp and upnp. If
│ │ │ │ mapping was already made, they are deleted and added again. This only
│ │ │ │ works if natpmp and/or upnp are configured to be enable.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ wwrriittee__sseessssiioonn__ppaarraammss__bbuuff(()) wwrriittee__sseessssiioonn__ppaarraammss(()) rreeaadd__sseessssiioonn__ppaarraammss(())
│ │ │ │ +************ wwrriittee__sseessssiioonn__ppaarraammss(()) wwrriittee__sseessssiioonn__ppaarraammss__bbuuff(()) rreeaadd__sseessssiioonn__ppaarraammss(())
│ │ │ │ ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___p_a_r_a_m_s_._h_p_p"
│ │ │ │ -session_params rreeaadd__sseessssiioonn__ppaarraammss (bdecode_node const& e
│ │ │ │ - , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ │ -entry wwrriittee__sseessssiioonn__ppaarraammss (session_params const& sp
│ │ │ │ +session_params rreeaadd__sseessssiioonn__ppaarraammss (span buf
│ │ │ │ , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ │ std::vector wwrriittee__sseessssiioonn__ppaarraammss__bbuuff (session_params const& sp
│ │ │ │ , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ │ -session_params rreeaadd__sseessssiioonn__ppaarraammss (span buf
│ │ │ │ +session_params rreeaadd__sseessssiioonn__ppaarraammss (bdecode_node const& e
│ │ │ │ + , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ │ +entry wwrriittee__sseessssiioonn__ppaarraammss (session_params const& sp
│ │ │ │ , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ │ These functions serialize and de-serialize a session_params object to and from
│ │ │ │ bencoded form. The _s_e_s_s_i_o_n___p_a_r_a_m_s object is used to initialize a new _s_e_s_s_i_o_n
│ │ │ │ using the state from a previous one (or by programmatically configure the
│ │ │ │ _s_e_s_s_i_o_n up-front). The flags parameter can be used to only save and load
│ │ │ │ certain aspects of the session's state. The _buf suffix indicates the function
│ │ │ │ operates on buffer rather than the bencoded structure. The torrents in a
│ │ ├── ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html
│ │ │ @@ -29,35 +29,35 @@
│ │ │
│ │ │
│ │ │ home
│ │ │
│ │ │
Table of contents
│ │ │
│ │ │
│ │ │ You have some control over session configuration through the session::apply_settings()
│ │ │ member function. To change one or more configuration options, create a settings_pack
│ │ │ object and fill it with the settings to be set and pass it in to session::apply_settings().
│ │ │ The settings_pack object is a collection of settings updates that are applied
│ │ │ to the session when passed to session::apply_settings(). It's empty when
│ │ │ @@ -4598,24 +4598,24 @@
│ │ │
│ │ │
│ │ │ struct settings_pack final : settings_interface
│ │ │ {
│ │ │ friend void apply_pack_impl (settings_pack const*
│ │ │ , aux::session_settings_single_thread&
│ │ │ , std::vector<void(aux::session_impl::*)()>*);
│ │ │ - void set_str (int name, std::string val) override;
│ │ │ - void set_bool (int name, bool val) override;
│ │ │ void set_int (int name, flags::bitfield_flag<Type, Tag> const val);
│ │ │ + void set_bool (int name, bool val) override;
│ │ │ + void set_str (int name, std::string val) override;
│ │ │ void set_int (int name, int val) override;
│ │ │ bool has_val (int name) const override;
│ │ │ void clear ();
│ │ │ void clear (int name);
│ │ │ - std::string const& get_str (int name) const override;
│ │ │ int get_int (int name) const override;
│ │ │ bool get_bool (int name) const override;
│ │ │ + std::string const& get_str (int name) const override;
│ │ │ void for_each (Fun&& f) const;
│ │ │
│ │ │ enum type_bases
│ │ │ {
│ │ │ string_type_base,
│ │ │ int_type_base,
│ │ │ bool_type_base,
│ │ │ @@ -4685,22 +4685,22 @@
│ │ │ socks5,
│ │ │ socks5_pw,
│ │ │ http,
│ │ │ http_pw,
│ │ │ };
│ │ │ };
│ │ │
│ │ │ +
│ │ │
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
set_bool() set_str() set_int()
│ │ │ +
[report issue]
│ │ │ +
set_int() set_bool() set_str()
│ │ │
│ │ │ -void set_str (int name, std::string val) override;
│ │ │ -void set_bool (int name, bool val) override;
│ │ │ void set_int (int name, flags::bitfield_flag<Type, Tag> const val);
│ │ │ +void set_bool (int name, bool val) override;
│ │ │ +void set_str (int name, std::string val) override;
│ │ │ void set_int (int name, int val) override;
│ │ │
│ │ │
set a configuration option in the settings_pack. name is one of
│ │ │ the enum values from string_types, int_types or bool_types. They must
│ │ │ match the respective type of the set_* function.
│ │ │
[report issue]
│ │ │
│ │ │ @@ -4722,22 +4722,22 @@
│ │ │
│ │ │
clear()
│ │ │
│ │ │ void clear (int name);
│ │ │
│ │ │
clear a specific setting from the pack
│ │ │
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
get_bool() get_int() get_str()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
get_bool() get_str() get_int()
│ │ │
│ │ │ -std::string const& get_str (int name) const override;
│ │ │ int get_int (int name) const override;
│ │ │ bool get_bool (int name) const override;
│ │ │ +std::string const& get_str (int name) const override;
│ │ │
│ │ │
queries the current configuration option from the settings_pack.
│ │ │ name is one of the enumeration values from string_types, int_types
│ │ │ or bool_types. The enum value must match the type of the get_*
│ │ │ function. If the specified setting field has not been set, the default
│ │ │ value is returned.
│ │ │
[report issue]
│ │ │ @@ -5096,16 +5096,64 @@
│ │ │
| http_pw |
│ │ │ 5 |
│ │ │ The server is assumed to be an HTTP proxy that requires user
│ │ │ authorization. The username and password will be sent to the proxy. |
│ │ │
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ +
│ │ │ +
[report issue]
│ │ │
│ │ │ +
│ │ │ +
setting_by_name() name_for_setting()
│ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ +
│ │ │ +char const* name_for_setting (int s);
│ │ │ +int setting_by_name (string_view name);
│ │ │ +
│ │ │ +
converts a setting integer (from the enums string_types, int_types or
│ │ │ +bool_types) to a string, and vice versa.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │
│ │ │
generate_fingerprint()
│ │ │
Declared in "libtorrent/fingerprint.hpp"
│ │ │
│ │ │ std::string generate_fingerprint (std::string name
│ │ │ , int major, int minor = 0, int revision = 0, int tag = 0);
│ │ │
│ │ │ @@ -5154,62 +5202,14 @@
│ │ │
Tribler |
│ │ │
│ │ │
│ │ │
│ │ │
There's an informal directory of client id's here.
│ │ │
The major, minor, revision and tag parameters are used to
│ │ │ identify the version of your client.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
name_for_setting() setting_by_name()
│ │ │ -
Declared in "libtorrent/settings_pack.hpp"
│ │ │ -
│ │ │ -int setting_by_name (string_view name);
│ │ │ -char const* name_for_setting (int s);
│ │ │ -
│ │ │ -
converts a setting integer (from the enums string_types, int_types or
│ │ │ -bool_types) to a string, and vice versa.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
default_settings()
│ │ │ -
Declared in "libtorrent/settings_pack.hpp"
│ │ │ -
│ │ │ -settings_pack default_settings ();
│ │ │ -
│ │ │ -
returns a settings_pack with every setting set to its default value
│ │ │
│ │ │
│ │ │
│ │ │