Added accessor functions for upload_rate_limit and download_rate_limit

This commit is contained in:
Daniel Wallin
2007-01-01 23:51:24 +00:00
parent 0f3874028b
commit 39b977973f
4 changed files with 29 additions and 1 deletions

View File

@@ -1566,7 +1566,6 @@ namespace libtorrent { namespace detail
#endif
void session_impl::set_download_rate_limit(int bytes_per_second)
{
assert(bytes_per_second > 0 || bytes_per_second == -1);
@@ -1677,6 +1676,18 @@ namespace libtorrent { namespace detail
m_alerts.set_severity(s);
}
int session_impl::upload_rate_limit() const
{
mutex_t::scoped_lock l(m_mutex);
return m_upload_rate;
}
int session_impl::download_rate_limit() const
{
mutex_t::scoped_lock l(m_mutex);
return m_download_rate;
}
#ifndef NDEBUG
void session_impl::check_invariant(const char *place)
{