*** empty log message ***
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
<li><a class="reference" href="#set-upload-limit-set-download-limit" id="id49" name="id49">set_upload_limit() set_download_limit()</a></li>
|
<li><a class="reference" href="#set-upload-limit-set-download-limit" id="id49" name="id49">set_upload_limit() set_download_limit()</a></li>
|
||||||
<li><a class="reference" href="#pause-resume-is-paused" id="id50" name="id50">pause() resume() is_paused()</a></li>
|
<li><a class="reference" href="#pause-resume-is-paused" id="id50" name="id50">pause() resume() is_paused()</a></li>
|
||||||
<li><a class="reference" href="#is-seed" id="id51" name="id51">is_seed()</a></li>
|
<li><a class="reference" href="#is-seed" id="id51" name="id51">is_seed()</a></li>
|
||||||
<li><a class="reference" href="#num-complete-num-incomplete-num-downloaded" id="id52" name="id52">num_complete() num_incomplete() num_downloaded()</a></li>
|
<li><a class="reference" href="#num-complete-num-incomplete" id="id52" name="id52">num_complete() num_incomplete()</a></li>
|
||||||
<li><a class="reference" href="#has-metadata" id="id53" name="id53">has_metadata()</a></li>
|
<li><a class="reference" href="#has-metadata" id="id53" name="id53">has_metadata()</a></li>
|
||||||
<li><a class="reference" href="#set-tracker-login" id="id54" name="id54">set_tracker_login()</a></li>
|
<li><a class="reference" href="#set-tracker-login" id="id54" name="id54">set_tracker_login()</a></li>
|
||||||
<li><a class="reference" href="#use-interface" id="id55" name="id55">use_interface()</a></li>
|
<li><a class="reference" href="#use-interface" id="id55" name="id55">use_interface()</a></li>
|
||||||
@@ -869,7 +869,6 @@ struct torrent_handle
|
|||||||
|
|
||||||
int num_complete() const;
|
int num_complete() const;
|
||||||
int num_incomplete() const;
|
int num_incomplete() const;
|
||||||
int num_downloaded() const;
|
|
||||||
|
|
||||||
bool has_metadata() const;
|
bool has_metadata() const;
|
||||||
|
|
||||||
@@ -989,21 +988,19 @@ bool is_seed() const;
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Returns true if the torrent is in seed mode (i.e. if it has finished downloading).</p>
|
<p>Returns true if the torrent is in seed mode (i.e. if it has finished downloading).</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="num-complete-num-incomplete-num-downloaded">
|
<div class="section" id="num-complete-num-incomplete">
|
||||||
<h2><a name="num-complete-num-incomplete-num-downloaded">num_complete() num_incomplete() num_downloaded()</a></h2>
|
<h2><a name="num-complete-num-incomplete">num_complete() num_incomplete()</a></h2>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre class="literal-block">
|
<pre class="literal-block">
|
||||||
int num_complete() const;
|
int num_complete() const;
|
||||||
int num_incomplete() const;
|
int num_incomplete() const;
|
||||||
int num_downloaded() const;
|
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>These members returns the optional scrape data returned by the tracker in the announce response.
|
<p>These members returns the optional scrape data returned by the tracker in the announce response.
|
||||||
If the tracker did not return any scrape data the return value of these functions are -1. Note
|
If the tracker did not return any scrape data the return value of these functions are -1. Note
|
||||||
that in some cases the tracker can return some scrape data, so there is no guarantee that all
|
that in some cases the tracker can return some scrape data, so there is no guarantee that all
|
||||||
functions returns -1 just because one of them do. <tt class="docutils literal"><span class="pre">num_complete()</span></tt> is the total number of
|
functions returns -1 just because one of them do. <tt class="docutils literal"><span class="pre">num_complete()</span></tt> is the total number of
|
||||||
seeds in the swarm. <tt class="docutils literal"><span class="pre">num_incomplete()</span></tt> is the number of downloaders in the swarm and
|
seeds in the swarm and <tt class="docutils literal"><span class="pre">num_incomplete()</span></tt> is the number of downloaders in the swarm.</p>
|
||||||
<tt class="docutils literal"><span class="pre">num_downloaded()</span></tt> is the number of times this torrent has been downloaded.</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="has-metadata">
|
<div class="section" id="has-metadata">
|
||||||
<h2><a name="has-metadata">has_metadata()</a></h2>
|
<h2><a name="has-metadata">has_metadata()</a></h2>
|
||||||
|
@@ -803,7 +803,6 @@ Its declaration looks like this::
|
|||||||
|
|
||||||
int num_complete() const;
|
int num_complete() const;
|
||||||
int num_incomplete() const;
|
int num_incomplete() const;
|
||||||
int num_downloaded() const;
|
|
||||||
|
|
||||||
bool has_metadata() const;
|
bool has_metadata() const;
|
||||||
|
|
||||||
@@ -931,21 +930,20 @@ is_seed()
|
|||||||
|
|
||||||
Returns true if the torrent is in seed mode (i.e. if it has finished downloading).
|
Returns true if the torrent is in seed mode (i.e. if it has finished downloading).
|
||||||
|
|
||||||
num_complete() num_incomplete() num_downloaded()
|
|
||||||
------------------------------------------------
|
num_complete() num_incomplete()
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
int num_complete() const;
|
int num_complete() const;
|
||||||
int num_incomplete() const;
|
int num_incomplete() const;
|
||||||
int num_downloaded() const;
|
|
||||||
|
|
||||||
These members returns the optional scrape data returned by the tracker in the announce response.
|
These members returns the optional scrape data returned by the tracker in the announce response.
|
||||||
If the tracker did not return any scrape data the return value of these functions are -1. Note
|
If the tracker did not return any scrape data the return value of these functions are -1. Note
|
||||||
that in some cases the tracker can return some scrape data, so there is no guarantee that all
|
that in some cases the tracker can return some scrape data, so there is no guarantee that all
|
||||||
functions returns -1 just because one of them do. ``num_complete()`` is the total number of
|
functions returns -1 just because one of them do. ``num_complete()`` is the total number of
|
||||||
seeds in the swarm. ``num_incomplete()`` is the number of downloaders in the swarm and
|
seeds in the swarm and ``num_incomplete()`` is the number of downloaders in the swarm.
|
||||||
``num_downloaded()`` is the number of times this torrent has been downloaded.
|
|
||||||
|
|
||||||
|
|
||||||
has_metadata()
|
has_metadata()
|
||||||
|
@@ -156,9 +156,6 @@ namespace libtorrent
|
|||||||
int num_incomplete() const
|
int num_incomplete() const
|
||||||
{ return m_incomplete; }
|
{ return m_incomplete; }
|
||||||
|
|
||||||
int num_downloaded() const
|
|
||||||
{ return m_downloaded; }
|
|
||||||
|
|
||||||
// --------------------------------------------
|
// --------------------------------------------
|
||||||
// PEER MANAGEMENT
|
// PEER MANAGEMENT
|
||||||
|
|
||||||
@@ -202,7 +199,7 @@ namespace libtorrent
|
|||||||
// when this torrent got a response from its tracker request
|
// when this torrent got a response from its tracker request
|
||||||
// or when a failure occured
|
// or when a failure occured
|
||||||
virtual void tracker_response(std::vector<peer_entry>& e, int interval
|
virtual void tracker_response(std::vector<peer_entry>& e, int interval
|
||||||
, int complete, int incomplete, int downloaded);
|
, int complete, int incomplete);
|
||||||
virtual void tracker_request_timed_out();
|
virtual void tracker_request_timed_out();
|
||||||
virtual void tracker_request_error(int response_code, const std::string& str);
|
virtual void tracker_request_error(int response_code, const std::string& str);
|
||||||
|
|
||||||
@@ -407,7 +404,6 @@ namespace libtorrent
|
|||||||
// is optional and may be -1.
|
// is optional and may be -1.
|
||||||
int m_complete;
|
int m_complete;
|
||||||
int m_incomplete;
|
int m_incomplete;
|
||||||
int m_downloaded;
|
|
||||||
|
|
||||||
std::map<address, peer_connection*> m_connections;
|
std::map<address, peer_connection*> m_connections;
|
||||||
|
|
||||||
|
@@ -202,7 +202,6 @@ namespace libtorrent
|
|||||||
// (optional, only sent by some trackers)
|
// (optional, only sent by some trackers)
|
||||||
int num_complete() const;
|
int num_complete() const;
|
||||||
int num_incomplete() const;
|
int num_incomplete() const;
|
||||||
int num_downloaded() const;
|
|
||||||
|
|
||||||
// set the interface to bind outgoing connections
|
// set the interface to bind outgoing connections
|
||||||
// to.
|
// to.
|
||||||
|
@@ -106,8 +106,7 @@ namespace libtorrent
|
|||||||
std::vector<peer_entry>& peers
|
std::vector<peer_entry>& peers
|
||||||
, int interval
|
, int interval
|
||||||
, int complete
|
, int complete
|
||||||
, int incomplete
|
, int incomplete) = 0;
|
||||||
, int downloaded) = 0;
|
|
||||||
virtual void tracker_request_timed_out() = 0;
|
virtual void tracker_request_timed_out() = 0;
|
||||||
virtual void tracker_request_error(
|
virtual void tracker_request_error(
|
||||||
int response_code
|
int response_code
|
||||||
|
@@ -598,20 +598,15 @@ namespace libtorrent
|
|||||||
// look for optional crape info
|
// look for optional crape info
|
||||||
int complete = -1;
|
int complete = -1;
|
||||||
int incomplete = -1;
|
int incomplete = -1;
|
||||||
int downloaded = -1;
|
|
||||||
try
|
try { complete = e["complete"].integer(); }
|
||||||
{
|
catch(type_error& e) {}
|
||||||
entry const& f = e["files"];
|
|
||||||
entry const& sd = f[std::string(m_req.info_hash.begin()
|
try { incomplete = e["incomplete"].integer(); }
|
||||||
, m_req.info_hash.end())];
|
|
||||||
complete = sd["complete"].integer();
|
|
||||||
incomplete = sd["incomplete"].integer();
|
|
||||||
downloaded = sd["downloaded"].integer();
|
|
||||||
}
|
|
||||||
catch(type_error& e) {}
|
catch(type_error& e) {}
|
||||||
|
|
||||||
requester().tracker_response(peer_list, interval, complete
|
requester().tracker_response(peer_list, interval, complete
|
||||||
, incomplete, downloaded);
|
, incomplete);
|
||||||
}
|
}
|
||||||
catch(type_error& e)
|
catch(type_error& e)
|
||||||
{
|
{
|
||||||
|
@@ -162,7 +162,6 @@ namespace libtorrent
|
|||||||
, m_duration(1800)
|
, m_duration(1800)
|
||||||
, m_complete(-1)
|
, m_complete(-1)
|
||||||
, m_incomplete(-1)
|
, m_incomplete(-1)
|
||||||
, m_downloaded(-1)
|
|
||||||
, m_policy()
|
, m_policy()
|
||||||
, m_ses(ses)
|
, m_ses(ses)
|
||||||
, m_picker(0)
|
, m_picker(0)
|
||||||
@@ -208,7 +207,6 @@ namespace libtorrent
|
|||||||
, m_duration(1800)
|
, m_duration(1800)
|
||||||
, m_complete(-1)
|
, m_complete(-1)
|
||||||
, m_incomplete(-1)
|
, m_incomplete(-1)
|
||||||
, m_downloaded(-1)
|
|
||||||
, m_policy()
|
, m_policy()
|
||||||
, m_ses(ses)
|
, m_ses(ses)
|
||||||
, m_picker(0)
|
, m_picker(0)
|
||||||
@@ -279,8 +277,7 @@ namespace libtorrent
|
|||||||
std::vector<peer_entry>& peer_list
|
std::vector<peer_entry>& peer_list
|
||||||
, int interval
|
, int interval
|
||||||
, int complete
|
, int complete
|
||||||
, int incomplete
|
, int incomplete)
|
||||||
, int downloaded)
|
|
||||||
{
|
{
|
||||||
m_failed_trackers = 0;
|
m_failed_trackers = 0;
|
||||||
// less than 5 minutes announce intervals
|
// less than 5 minutes announce intervals
|
||||||
@@ -305,7 +302,6 @@ namespace libtorrent
|
|||||||
|
|
||||||
if (complete >= 0) m_complete = complete;
|
if (complete >= 0) m_complete = complete;
|
||||||
if (incomplete >= 0) m_incomplete = incomplete;
|
if (incomplete >= 0) m_incomplete = incomplete;
|
||||||
if (downloaded >= 0) m_downloaded = downloaded;
|
|
||||||
|
|
||||||
// connect to random peers from the list
|
// connect to random peers from the list
|
||||||
std::random_shuffle(peer_list.begin(), peer_list.end());
|
std::random_shuffle(peer_list.begin(), peer_list.end());
|
||||||
@@ -943,7 +939,7 @@ namespace libtorrent
|
|||||||
assert(m_storage.get());
|
assert(m_storage.get());
|
||||||
assert(piece_index >= 0);
|
assert(piece_index >= 0);
|
||||||
assert(piece_index < m_torrent_file.num_pieces());
|
assert(piece_index < m_torrent_file.num_pieces());
|
||||||
assert(piece_index < m_have_pieces.size());
|
assert(piece_index < (int)m_have_pieces.size());
|
||||||
|
|
||||||
int size = static_cast<int>(m_torrent_file.piece_size(piece_index));
|
int size = static_cast<int>(m_torrent_file.piece_size(piece_index));
|
||||||
std::vector<char> buffer(size);
|
std::vector<char> buffer(size);
|
||||||
@@ -1123,7 +1119,7 @@ namespace libtorrent
|
|||||||
std::pair<int, int> req = offset_to_req(std::make_pair(offset, size)
|
std::pair<int, int> req = offset_to_req(std::make_pair(offset, size)
|
||||||
, total_size);
|
, total_size);
|
||||||
|
|
||||||
assert(req.first + req.second <= m_have_metadata.size());
|
assert(req.first + req.second <= (int)m_have_metadata.size());
|
||||||
|
|
||||||
std::fill(
|
std::fill(
|
||||||
m_have_metadata.begin() + req.first
|
m_have_metadata.begin() + req.first
|
||||||
|
@@ -286,13 +286,6 @@ namespace libtorrent
|
|||||||
, bind(&torrent::num_incomplete, _1));
|
, bind(&torrent::num_incomplete, _1));
|
||||||
}
|
}
|
||||||
|
|
||||||
int torrent_handle::num_downloaded() const
|
|
||||||
{
|
|
||||||
INVARIANT_CHECK;
|
|
||||||
return call_member<int>(m_ses, m_chk, m_info_hash
|
|
||||||
, bind(&torrent::num_downloaded, _1));
|
|
||||||
}
|
|
||||||
|
|
||||||
void torrent_handle::set_tracker_login(std::string const& name, std::string const& password)
|
void torrent_handle::set_tracker_login(std::string const& name, std::string const& password)
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
@@ -278,7 +278,7 @@ namespace libtorrent
|
|||||||
peer_list.push_back(e);
|
peer_list.push_back(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
requester().tracker_response(peer_list, interval, complete, incomplete, -1);
|
requester().tracker_response(peer_list, interval, complete, incomplete);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user