forked from premiere/premiere-libtorrent
Add get_ip_filter() to session
This commit is contained in:
parent
a3bacd736e
commit
c401c65dfb
|
@ -82,6 +82,7 @@ release 0.14.5
|
||||||
disabled
|
disabled
|
||||||
* fixed race condition in UPnP which could lead to crash
|
* fixed race condition in UPnP which could lead to crash
|
||||||
* fixed inversed seed_time ratio logic
|
* fixed inversed seed_time ratio logic
|
||||||
|
* added get_ip_filter() to session
|
||||||
|
|
||||||
release 0.14.4
|
release 0.14.4
|
||||||
|
|
||||||
|
|
|
@ -332,6 +332,7 @@ void bind_session()
|
||||||
.def("start_natpmp", &start_natpmp)
|
.def("start_natpmp", &start_natpmp)
|
||||||
.def("stop_natpmp", allow_threads(&session::stop_natpmp))
|
.def("stop_natpmp", allow_threads(&session::stop_natpmp))
|
||||||
.def("set_ip_filter", allow_threads(&session::set_ip_filter))
|
.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("find_torrent", allow_threads(&session::find_torrent))
|
||||||
.def("get_torrents", &get_torrents)
|
.def("get_torrents", &get_torrents)
|
||||||
.def("pause", allow_threads(&session::pause))
|
.def("pause", allow_threads(&session::pause))
|
||||||
|
|
|
@ -184,7 +184,8 @@ The ``session`` class has the following synopsis::
|
||||||
entry state() const;
|
entry state() const;
|
||||||
|
|
||||||
void set_ip_filter(ip_filter const& f);
|
void set_ip_filter(ip_filter const& f);
|
||||||
|
ip_filter const& get_ip_filter() const;
|
||||||
|
|
||||||
session_status status() const;
|
session_status status() const;
|
||||||
cache_status get_cache_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
|
Each time a peer is blocked because of the IP filter, a peer_blocked_alert_ is
|
||||||
generated.
|
generated.
|
||||||
|
|
||||||
|
get_ip_filter()
|
||||||
|
---------------
|
||||||
|
|
||||||
|
::
|
||||||
|
ip_filter const& get_ip_filter() const;
|
||||||
|
|
||||||
|
Returns the ip_filter currently in the session. See ip_filter_.
|
||||||
|
|
||||||
|
|
||||||
status()
|
status()
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -204,6 +204,8 @@ namespace libtorrent
|
||||||
void resume();
|
void resume();
|
||||||
|
|
||||||
void set_ip_filter(ip_filter const& f);
|
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_port_filter(port_filter const& f);
|
||||||
|
|
||||||
bool listen_on(
|
bool listen_on(
|
||||||
|
|
|
@ -308,6 +308,8 @@ namespace libtorrent
|
||||||
entry state() const;
|
entry state() const;
|
||||||
|
|
||||||
void set_ip_filter(ip_filter const& f);
|
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_port_filter(port_filter const& f);
|
||||||
void set_peer_id(peer_id const& pid);
|
void set_peer_id(peer_id const& pid);
|
||||||
void set_key(int key);
|
void set_key(int key);
|
||||||
|
|
|
@ -387,6 +387,11 @@ namespace libtorrent
|
||||||
session_impl::mutex_t::scoped_lock l(m_impl->m_mutex);
|
session_impl::mutex_t::scoped_lock l(m_impl->m_mutex);
|
||||||
m_impl->set_ip_filter(f);
|
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)
|
void session::set_port_filter(port_filter const& f)
|
||||||
{
|
{
|
||||||
|
|
|
@ -620,6 +620,12 @@ namespace aux {
|
||||||
i->second->ip_filter_updated();
|
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)
|
void session_impl::set_settings(session_settings const& s)
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
|
Loading…
Reference in New Issue