diff options
author | Martijn Otto <git@martijnotto.nl> | 2018-11-07 09:24:50 +0100 |
---|---|---|
committer | Martijn Otto <git@martijnotto.nl> | 2018-11-07 11:21:52 +0100 |
commit | 7c298f5d14e9ef47b812983fbb8a8f446b536fb5 (patch) | |
tree | 4f8ab5ae62c9c8e3bf3da57d29bb5a42b3397c8e /contrib/epee/include/net/abstract_tcp_server2.h | |
parent | Merge pull request #4809 (diff) | |
download | monero-7c298f5d14e9ef47b812983fbb8a8f446b536fb5.tar.xz |
No longer use a list for registering self references in the abstract tcp
server
Updated assert message
Use a local variable that won't destruct at the end of the if-branch
Updated comment
Diffstat (limited to 'contrib/epee/include/net/abstract_tcp_server2.h')
-rw-r--r-- | contrib/epee/include/net/abstract_tcp_server2.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/epee/include/net/abstract_tcp_server2.h b/contrib/epee/include/net/abstract_tcp_server2.h index 3f726a352..df2b9d1b2 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.h +++ b/contrib/epee/include/net/abstract_tcp_server2.h @@ -155,7 +155,8 @@ namespace net_utils //this should be the last one, because it could be wait on destructor, while other activities possible on other threads t_protocol_handler m_protocol_handler; //typename t_protocol_handler::config_type m_dummy_config; - std::list<boost::shared_ptr<connection<t_protocol_handler> > > m_self_refs; // add_ref/release support + size_t m_reference_count = 0; // reference count managed through add_ref/release support + boost::shared_ptr<connection<t_protocol_handler> > m_self_ref; // the reference to hold critical_section m_self_refs_lock; critical_section m_chunking_lock; // held while we add small chunks of the big do_send() to small do_send_chunk() critical_section m_shutdown_lock; // held while shutting down |