forked from premiere/premiere-libtorrent
added torrent_handle::set_download_limit() and fixed typo, thanks to spyhole for reporting
This commit is contained in:
parent
2baa01e3ec
commit
e23bf90089
|
@ -334,7 +334,7 @@ remove_torrent()
|
||||||
the tracker that we've stopped participating in the swarm.
|
the tracker that we've stopped participating in the swarm.
|
||||||
|
|
||||||
|
|
||||||
set_upload_rate_limit() set_downlad_rate_limit()
|
set_upload_rate_limit() set_download_rate_limit()
|
||||||
------------------------------------------------
|
------------------------------------------------
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
|
@ -185,6 +185,7 @@ namespace libtorrent
|
||||||
// abort the torrent.
|
// abort the torrent.
|
||||||
|
|
||||||
void set_upload_limit(int limit);
|
void set_upload_limit(int limit);
|
||||||
|
void set_download_limit(int limit);
|
||||||
|
|
||||||
// manually connect a peer
|
// manually connect a peer
|
||||||
void connect_peer(const address& adr) const;
|
void connect_peer(const address& adr) const;
|
||||||
|
|
|
@ -921,7 +921,7 @@ namespace libtorrent
|
||||||
if (!have_all) return false;
|
if (!have_all) return false;
|
||||||
|
|
||||||
hasher h;
|
hasher h;
|
||||||
h.update(&m_metadata[0], m_metadata.size());
|
h.update(&m_metadata[0], (int)m_metadata.size());
|
||||||
sha1_hash info_hash = h.final();
|
sha1_hash info_hash = h.final();
|
||||||
|
|
||||||
if (info_hash != m_torrent_file.info_hash())
|
if (info_hash != m_torrent_file.info_hash())
|
||||||
|
|
|
@ -212,6 +212,16 @@ namespace libtorrent
|
||||||
, boost::bind(&torrent::set_upload_limit, _1, limit));
|
, boost::bind(&torrent::set_upload_limit, _1, limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void torrent_handle::set_download_limit(int limit)
|
||||||
|
{
|
||||||
|
INVARIANT_CHECK;
|
||||||
|
|
||||||
|
assert(limit >= -1);
|
||||||
|
|
||||||
|
call_member<void>(m_ses, m_chk, m_info_hash
|
||||||
|
, boost::bind(&torrent::set_download_limit, _1, limit));
|
||||||
|
}
|
||||||
|
|
||||||
bool torrent_handle::is_paused() const
|
bool torrent_handle::is_paused() const
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
|
Loading…
Reference in New Issue