forked from premiere/premiere-libtorrent
*** empty log message ***
This commit is contained in:
parent
69e268c959
commit
5c5aabe7b1
|
@ -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="#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="#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="#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>
|
||||
|
@ -869,7 +869,6 @@ struct torrent_handle
|
|||
|
||||
int num_complete() const;
|
||||
int num_incomplete() const;
|
||||
int num_downloaded() const;
|
||||
|
||||
bool has_metadata() const;
|
||||
|
||||
|
@ -989,21 +988,19 @@ bool is_seed() const;
|
|||
</blockquote>
|
||||
<p>Returns true if the torrent is in seed mode (i.e. if it has finished downloading).</p>
|
||||
</div>
|
||||
<div class="section" id="num-complete-num-incomplete-num-downloaded">
|
||||
<h2><a name="num-complete-num-incomplete-num-downloaded">num_complete() num_incomplete() num_downloaded()</a></h2>
|
||||
<div class="section" id="num-complete-num-incomplete">
|
||||
<h2><a name="num-complete-num-incomplete">num_complete() num_incomplete()</a></h2>
|
||||
<blockquote>
|
||||
<pre class="literal-block">
|
||||
int num_complete() const;
|
||||
int num_incomplete() const;
|
||||
int num_downloaded() const;
|
||||
</pre>
|
||||
</blockquote>
|
||||
<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
|
||||
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
|
||||
seeds in the swarm. <tt class="docutils literal"><span class="pre">num_incomplete()</span></tt> is the number of downloaders in the swarm and
|
||||
<tt class="docutils literal"><span class="pre">num_downloaded()</span></tt> is the number of times this torrent has been downloaded.</p>
|
||||
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>
|
||||
</div>
|
||||
<div class="section" id="has-metadata">
|
||||
<h2><a name="has-metadata">has_metadata()</a></h2>
|
||||
|
|
|
@ -803,7 +803,6 @@ Its declaration looks like this::
|
|||
|
||||
int num_complete() const;
|
||||
int num_incomplete() const;
|
||||
int num_downloaded() 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).
|
||||
|
||||
num_complete() num_incomplete() num_downloaded()
|
||||
------------------------------------------------
|
||||
|
||||
num_complete() num_incomplete()
|
||||
-------------------------------
|
||||
|
||||
::
|
||||
|
||||
int num_complete() const;
|
||||
int num_incomplete() const;
|
||||
int num_downloaded() const;
|
||||
|
||||
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
|
||||
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
|
||||
seeds in the swarm. ``num_incomplete()`` is the number of downloaders in the swarm and
|
||||
``num_downloaded()`` is the number of times this torrent has been downloaded.
|
||||
seeds in the swarm and ``num_incomplete()`` is the number of downloaders in the swarm.
|
||||
|
||||
|
||||
has_metadata()
|
||||
|
|
|
@ -156,9 +156,6 @@ namespace libtorrent
|
|||
int num_incomplete() const
|
||||
{ return m_incomplete; }
|
||||
|
||||
int num_downloaded() const
|
||||
{ return m_downloaded; }
|
||||
|
||||
// --------------------------------------------
|
||||
// PEER MANAGEMENT
|
||||
|
||||
|
@ -202,7 +199,7 @@ namespace libtorrent
|
|||
// when this torrent got a response from its tracker request
|
||||
// or when a failure occured
|
||||
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_error(int response_code, const std::string& str);
|
||||
|
||||
|
@ -407,7 +404,6 @@ namespace libtorrent
|
|||
// is optional and may be -1.
|
||||
int m_complete;
|
||||
int m_incomplete;
|
||||
int m_downloaded;
|
||||
|
||||
std::map<address, peer_connection*> m_connections;
|
||||
|
||||
|
|
|
@ -202,7 +202,6 @@ namespace libtorrent
|
|||
// (optional, only sent by some trackers)
|
||||
int num_complete() const;
|
||||
int num_incomplete() const;
|
||||
int num_downloaded() const;
|
||||
|
||||
// set the interface to bind outgoing connections
|
||||
// to.
|
||||
|
|
|
@ -106,8 +106,7 @@ namespace libtorrent
|
|||
std::vector<peer_entry>& peers
|
||||
, int interval
|
||||
, int complete
|
||||
, int incomplete
|
||||
, int downloaded) = 0;
|
||||
, int incomplete) = 0;
|
||||
virtual void tracker_request_timed_out() = 0;
|
||||
virtual void tracker_request_error(
|
||||
int response_code
|
||||
|
|
|
@ -598,20 +598,15 @@ namespace libtorrent
|
|||
// look for optional crape info
|
||||
int complete = -1;
|
||||
int incomplete = -1;
|
||||
int downloaded = -1;
|
||||
try
|
||||
{
|
||||
entry const& f = e["files"];
|
||||
entry const& sd = f[std::string(m_req.info_hash.begin()
|
||||
, m_req.info_hash.end())];
|
||||
complete = sd["complete"].integer();
|
||||
incomplete = sd["incomplete"].integer();
|
||||
downloaded = sd["downloaded"].integer();
|
||||
}
|
||||
|
||||
try { complete = e["complete"].integer(); }
|
||||
catch(type_error& e) {}
|
||||
|
||||
try { incomplete = e["incomplete"].integer(); }
|
||||
catch(type_error& e) {}
|
||||
|
||||
requester().tracker_response(peer_list, interval, complete
|
||||
, incomplete, downloaded);
|
||||
, incomplete);
|
||||
}
|
||||
catch(type_error& e)
|
||||
{
|
||||
|
|
|
@ -162,7 +162,6 @@ namespace libtorrent
|
|||
, m_duration(1800)
|
||||
, m_complete(-1)
|
||||
, m_incomplete(-1)
|
||||
, m_downloaded(-1)
|
||||
, m_policy()
|
||||
, m_ses(ses)
|
||||
, m_picker(0)
|
||||
|
@ -208,7 +207,6 @@ namespace libtorrent
|
|||
, m_duration(1800)
|
||||
, m_complete(-1)
|
||||
, m_incomplete(-1)
|
||||
, m_downloaded(-1)
|
||||
, m_policy()
|
||||
, m_ses(ses)
|
||||
, m_picker(0)
|
||||
|
@ -279,8 +277,7 @@ namespace libtorrent
|
|||
std::vector<peer_entry>& peer_list
|
||||
, int interval
|
||||
, int complete
|
||||
, int incomplete
|
||||
, int downloaded)
|
||||
, int incomplete)
|
||||
{
|
||||
m_failed_trackers = 0;
|
||||
// less than 5 minutes announce intervals
|
||||
|
@ -305,7 +302,6 @@ namespace libtorrent
|
|||
|
||||
if (complete >= 0) m_complete = complete;
|
||||
if (incomplete >= 0) m_incomplete = incomplete;
|
||||
if (downloaded >= 0) m_downloaded = downloaded;
|
||||
|
||||
// connect to random peers from the list
|
||||
std::random_shuffle(peer_list.begin(), peer_list.end());
|
||||
|
@ -943,7 +939,7 @@ namespace libtorrent
|
|||
assert(m_storage.get());
|
||||
assert(piece_index >= 0);
|
||||
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));
|
||||
std::vector<char> buffer(size);
|
||||
|
@ -1123,7 +1119,7 @@ namespace libtorrent
|
|||
std::pair<int, int> req = offset_to_req(std::make_pair(offset, size)
|
||||
, total_size);
|
||||
|
||||
assert(req.first + req.second <= m_have_metadata.size());
|
||||
assert(req.first + req.second <= (int)m_have_metadata.size());
|
||||
|
||||
std::fill(
|
||||
m_have_metadata.begin() + req.first
|
||||
|
|
|
@ -286,13 +286,6 @@ namespace libtorrent
|
|||
, 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)
|
||||
{
|
||||
INVARIANT_CHECK;
|
||||
|
|
|
@ -278,7 +278,7 @@ namespace libtorrent
|
|||
peer_list.push_back(e);
|
||||
}
|
||||
|
||||
requester().tracker_response(peer_list, interval, complete, incomplete, -1);
|
||||
requester().tracker_response(peer_list, interval, complete, incomplete);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue