forked from premiere/premiere-libtorrent
fixed alert queue size limit bug when restoring setting from session state
This commit is contained in:
parent
c0bbac579a
commit
f90f9f6609
|
@ -128,9 +128,7 @@ namespace libtorrent {
|
||||||
class TORRENT_EXPORT alert_manager
|
class TORRENT_EXPORT alert_manager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum { queue_size_limit_default = 1000 };
|
alert_manager(io_service& ios, int queue_limit);
|
||||||
|
|
||||||
alert_manager(io_service& ios);
|
|
||||||
~alert_manager();
|
~alert_manager();
|
||||||
|
|
||||||
void post_alert(const alert& alert_);
|
void post_alert(const alert& alert_);
|
||||||
|
|
|
@ -455,6 +455,9 @@ namespace libtorrent
|
||||||
void on_lsd_peer(tcp::endpoint peer, sha1_hash const& ih);
|
void on_lsd_peer(tcp::endpoint peer, sha1_hash const& ih);
|
||||||
void setup_socket_buffers(socket_type& s);
|
void setup_socket_buffers(socket_type& s);
|
||||||
|
|
||||||
|
// the settings for the client
|
||||||
|
session_settings m_settings;
|
||||||
|
|
||||||
// this is a shared pool where policy_peer objects
|
// this is a shared pool where policy_peer objects
|
||||||
// are allocated. It's a pool since we're likely
|
// are allocated. It's a pool since we're likely
|
||||||
// to have tens of thousands of peers, and a pool
|
// to have tens of thousands of peers, and a pool
|
||||||
|
@ -670,9 +673,6 @@ namespace libtorrent
|
||||||
listen_socket_t setup_listener(tcp::endpoint ep, int retries
|
listen_socket_t setup_listener(tcp::endpoint ep, int retries
|
||||||
, bool v6_only, int flags, error_code& ec);
|
, bool v6_only, int flags, error_code& ec);
|
||||||
|
|
||||||
// the settings for the client
|
|
||||||
session_settings m_settings;
|
|
||||||
|
|
||||||
// the proxy used for bittorrent
|
// the proxy used for bittorrent
|
||||||
proxy_settings m_proxy;
|
proxy_settings m_proxy;
|
||||||
|
|
||||||
|
|
|
@ -328,9 +328,9 @@ namespace libtorrent {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
alert_manager::alert_manager(io_service& ios)
|
alert_manager::alert_manager(io_service& ios, int queue_limit)
|
||||||
: m_alert_mask(alert::error_notification)
|
: m_alert_mask(alert::error_notification)
|
||||||
, m_queue_size_limit(queue_size_limit_default)
|
, m_queue_size_limit(queue_limit)
|
||||||
, m_ios(ios)
|
, m_ios(ios)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
@ -478,7 +478,7 @@ namespace aux {
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
, m_ssl_ctx(m_io_service, asio::ssl::context::sslv23_client)
|
, m_ssl_ctx(m_io_service, asio::ssl::context::sslv23_client)
|
||||||
#endif
|
#endif
|
||||||
, m_alerts(m_io_service)
|
, m_alerts(m_io_service, m_settings.alert_queue_size)
|
||||||
, m_disk_thread(m_io_service, boost::bind(&session_impl::on_disk_queue, this), m_files)
|
, m_disk_thread(m_io_service, boost::bind(&session_impl::on_disk_queue, this), m_files)
|
||||||
, m_half_open(m_io_service)
|
, m_half_open(m_io_service)
|
||||||
, m_download_rate(peer_connection::download_channel)
|
, m_download_rate(peer_connection::download_channel)
|
||||||
|
@ -1078,9 +1078,9 @@ namespace aux {
|
||||||
}
|
}
|
||||||
|
|
||||||
update_rate_settings();
|
update_rate_settings();
|
||||||
|
|
||||||
update_connections_limit();
|
update_connections_limit();
|
||||||
update_unchoke_limit();
|
update_unchoke_limit();
|
||||||
|
m_alerts.set_alert_queue_size_limit(m_settings.alert_queue_size);
|
||||||
|
|
||||||
// in case we just set a socks proxy, we might have to
|
// in case we just set a socks proxy, we might have to
|
||||||
// open the socks incoming connection
|
// open the socks incoming connection
|
||||||
|
|
Loading…
Reference in New Issue