Add get_ip_filter() to session

This commit is contained in:
Andrew Resch 2009-07-21 01:52:37 +00:00
parent a3bacd736e
commit c401c65dfb
7 changed files with 27 additions and 1 deletions

View File

@ -82,6 +82,7 @@ release 0.14.5
disabled
* fixed race condition in UPnP which could lead to crash
* fixed inversed seed_time ratio logic
* added get_ip_filter() to session
release 0.14.4

View File

@ -332,6 +332,7 @@ void bind_session()
.def("start_natpmp", &start_natpmp)
.def("stop_natpmp", allow_threads(&session::stop_natpmp))
.def("set_ip_filter", allow_threads(&session::set_ip_filter))
.def("get_ip_filter", allow_threads(&session::get_ip_filter), return_value_policy<copy_const_reference>())
.def("find_torrent", allow_threads(&session::find_torrent))
.def("get_torrents", &get_torrents)
.def("pause", allow_threads(&session::pause))

View File

@ -184,7 +184,8 @@ The ``session`` class has the following synopsis::
entry state() const;
void set_ip_filter(ip_filter const& f);
ip_filter const& get_ip_filter() const;
session_status status() const;
cache_status get_cache_status() const;
@ -628,6 +629,14 @@ accepted and not, see ip_filter_.
Each time a peer is blocked because of the IP filter, a peer_blocked_alert_ is
generated.
get_ip_filter()
---------------
::
ip_filter const& get_ip_filter() const;
Returns the ip_filter currently in the session. See ip_filter_.
status()
--------

View File

@ -204,6 +204,8 @@ namespace libtorrent
void resume();
void set_ip_filter(ip_filter const& f);
ip_filter const& get_ip_filter() const;
void set_port_filter(port_filter const& f);
bool listen_on(

View File

@ -308,6 +308,8 @@ namespace libtorrent
entry state() const;
void set_ip_filter(ip_filter const& f);
ip_filter const& get_ip_filter() const;
void set_port_filter(port_filter const& f);
void set_peer_id(peer_id const& pid);
void set_key(int key);

View File

@ -387,6 +387,11 @@ namespace libtorrent
session_impl::mutex_t::scoped_lock l(m_impl->m_mutex);
m_impl->set_ip_filter(f);
}
ip_filter const& session::get_ip_filter() const
{
m_impl->get_ip_filter();
}
void session::set_port_filter(port_filter const& f)
{

View File

@ -620,6 +620,12 @@ namespace aux {
i->second->ip_filter_updated();
}
ip_filter const& session_impl::get_ip_filter() const
{
mutex_t::scoped_lock l(m_mutex);
return m_ip_filter;
}
void session_impl::set_settings(session_settings const& s)
{
INVARIANT_CHECK;