mirror of
https://github.com/monero-project/monero.git
synced 2025-08-07 13:42:28 -04:00
Merge pull request #9459
7e766e13c
Cleanup TCP throttling code (performance) + move connection checks (Lee *!* Clagett)
This commit is contained in:
commit
0e253622b2
7 changed files with 93 additions and 34 deletions
|
@ -77,6 +77,13 @@ namespace net_utils
|
|||
protected:
|
||||
virtual ~i_connection_filter(){}
|
||||
};
|
||||
|
||||
struct i_connection_limit
|
||||
{
|
||||
virtual bool is_host_limit(const epee::net_utils::network_address &address)=0;
|
||||
protected:
|
||||
virtual ~i_connection_limit(){}
|
||||
};
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
|
@ -261,10 +268,11 @@ namespace net_utils
|
|||
struct shared_state : connection_basic_shared_state, t_protocol_handler::config_type
|
||||
{
|
||||
shared_state()
|
||||
: connection_basic_shared_state(), t_protocol_handler::config_type(), pfilter(nullptr), stop_signal_sent(false)
|
||||
: connection_basic_shared_state(), t_protocol_handler::config_type(), pfilter(nullptr), plimit(nullptr), stop_signal_sent(false)
|
||||
{}
|
||||
|
||||
i_connection_filter* pfilter;
|
||||
i_connection_limit* plimit;
|
||||
bool stop_signal_sent;
|
||||
};
|
||||
|
||||
|
@ -371,6 +379,7 @@ namespace net_utils
|
|||
size_t get_threads_count(){return m_threads_count;}
|
||||
|
||||
void set_connection_filter(i_connection_filter* pfilter);
|
||||
void set_connection_limit(i_connection_limit* plimit);
|
||||
|
||||
void set_default_remote(epee::net_utils::network_address remote)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue