diff --git a/docs/manual.html b/docs/manual.html index 722764200..f72827256 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -1244,7 +1244,7 @@ struct torrent_handle entry write_resume_data() const; void force_reannounce() const; - void connect_peer(asio::ip::tcp::endpoint const& adr) const; + void connect_peer(asio::ip::tcp::endpoint const& adr, int source = 0) const; void set_tracker_login(std::string const& username , std::string const& password) const; @@ -1408,14 +1408,16 @@ peers. If the torrent is invalid, queued or in checking mode, this functions wil
-void connect_peer(asio::ip::tcp::endpoint const& adr) const; +void connect_peer(asio::ip::tcp::endpoint const& adr, int source = 0) const;
connect_peer() is a way to manually connect to peers that one believe is a part of the torrent. If the peer does not respond, or is not a member of this torrent, it will simply be disconnected. No harm can be done by using this other than an unnecessary connection attempt is made. If the torrent is uninitialized or in queued or checking mode, this -will throw invalid_handle.
+will throw invalid_handle. The second (optional) argument will be bitwised ORed into +the source mask of this peer. Typically this is one of the source flags in peer_info. +i.e. tracker, pex, dht etc.If sequenced download is activated (see torrent_handle), the distributed -copies will be saturated at the sequenced_download_threshold.
+If we are a seed, the piece picker is deallocated as an optimization, and +piece availability is no longer tracked. In this case the distributed +copies is set to -1.
block_size is the size of a block, in bytes. A block is a sub piece, it is the number of bytes that each piece request asks for and the number of bytes that each bit in the partial_piece_info's bitset represents @@ -1921,7 +1924,19 @@ struct peer_info connecting = 0x80, queued = 0x100 }; + unsigned int flags; + + enum peer_source_flags + { + tracker = 0x1, + dht = 0x2, + pex = 0x4, + lsd = 0x8 + }; + + int source; + asio::ip::tcp::endpoint ip; float up_speed; float down_speed; @@ -2004,6 +2019,33 @@ the number of half-open TCP connections. +
source is a combination of flags describing from which sources this peer +was received. The flags are:
+tracker | +The peer was received from the tracker. | +
dht | +The peer was received from the kademlia DHT. | +
pex | +The peer was received from the peer exchange +extension. | +
lsd | +The peer was received from the local service +discovery (The peer is on the local network). | +
resume_data | +The peer was added from the fast resume data. | +
The ip field is the IP-address to this peer. The type is an asio endpoint. For more info, see the asio documentation.
up_speed and down_speed contains the current upload and download speed diff --git a/docs/manual.rst b/docs/manual.rst index 4fd7d19e0..0ff1c21ef 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -1881,8 +1881,9 @@ pieces that have more copies than the rarest piece(s). For example: 2.5 would mean that the rarest pieces have only 2 copies among the peers this torrent is connected to, and that 50% of all the pieces have more than two copies. -If sequenced download is activated (see torrent_handle_), the distributed -copies will be saturated at the ``sequenced_download_threshold``. +If we are a seed, the piece picker is deallocated as an optimization, and +piece availability is no longer tracked. In this case the distributed +copies is set to -1. ``block_size`` is the size of a block, in bytes. A block is a sub piece, it is the number of bytes that each piece request asks for and the number of