added torrent_handle::set_download_limit() and fixed typo, thanks to spyhole for reporting

This commit is contained in:
Arvid Norberg 2004-07-01 18:51:13 +00:00
parent 2baa01e3ec
commit e23bf90089
4 changed files with 13 additions and 2 deletions

View File

@ -334,7 +334,7 @@ remove_torrent()
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()
------------------------------------------------
::

View File

@ -185,6 +185,7 @@ namespace libtorrent
// abort the torrent.
void set_upload_limit(int limit);
void set_download_limit(int limit);
// manually connect a peer
void connect_peer(const address& adr) const;

View File

@ -921,7 +921,7 @@ namespace libtorrent
if (!have_all) return false;
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();
if (info_hash != m_torrent_file.info_hash())

View File

@ -212,6 +212,16 @@ namespace libtorrent
, 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
{
INVARIANT_CHECK;