From bb25ef1cb667779727bd0293627401ff4a8e29da Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 11 Aug 2004 17:22:58 +0000 Subject: [PATCH] *** empty log message *** --- docs/manual.html | 7 +++++++ docs/manual.rst | 7 +++++++ include/libtorrent/torrent_handle.hpp | 6 ++++++ src/torrent.cpp | 1 + 4 files changed, 21 insertions(+) diff --git a/docs/manual.html b/docs/manual.html index dfea75179..5685b58da 100755 --- a/docs/manual.html +++ b/docs/manual.html @@ -1114,6 +1114,8 @@ struct torrent_status int num_seeds; float distributed_copies; + + int block_size; };

progress is a value in the range [0, 1], that represents the progress of the @@ -1187,6 +1189,11 @@ peers this client is connected to. The fractional part tells the share of 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.

+

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 +(see get_download_queue()). This is typically 16 kB, but it may be +larger if the pieces are larger.

peer_info

diff --git a/docs/manual.rst b/docs/manual.rst index aec98d885..003d8c0a5 100755 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -1084,6 +1084,8 @@ It contains the following fields:: int num_seeds; float distributed_copies; + + int block_size; }; ``progress`` is a value in the range [0, 1], that represents the progress of the @@ -1164,6 +1166,11 @@ 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. +``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 +(see `get_download_queue()`_). This is typically 16 kB, but it may be +larger if the pieces are larger. peer_info ========= diff --git a/include/libtorrent/torrent_handle.hpp b/include/libtorrent/torrent_handle.hpp index 115e3b02f..f200b5a7c 100755 --- a/include/libtorrent/torrent_handle.hpp +++ b/include/libtorrent/torrent_handle.hpp @@ -87,6 +87,7 @@ namespace libtorrent , total_done(0) , num_seeds(0) , distributed_copies(0.f) + , block_size(0) {} enum state_t @@ -152,6 +153,11 @@ namespace libtorrent // the fractional part tells the fraction of pieces that // have more copies than the rarest piece(s). float distributed_copies; + + // the block size that is used in this torrent. i.e. + // the number of bytes each piece request asks for + // and each bit in the download queue bitfield represents + int block_size; }; struct partial_piece_info diff --git a/src/torrent.cpp b/src/torrent.cpp index 181b1be80..6203ae806 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -873,6 +873,7 @@ namespace libtorrent torrent_status st; + st.block_size = block_size(); st.num_peers = num_peers(); st.paused = m_paused; st.total_done = bytes_done();