the file pool has been moved to the session and its size can be controlled via session_settings. Added untested option to allow multiple connections from the same IP.

This commit is contained in:
Arvid Norberg
2006-11-14 15:53:38 +00:00
parent 247b8ae443
commit 51e3261dd0
16 changed files with 172 additions and 83 deletions

View File

@@ -475,6 +475,7 @@ namespace libtorrent { namespace detail
, m_max_connections(-1)
, m_half_open_limit(-1)
, m_incoming_connection(false)
, m_files(40)
, m_last_tick(microsec_clock::universal_time())
, m_timer(m_selector)
, m_checker_impl(*this)
@@ -575,6 +576,7 @@ namespace libtorrent { namespace detail
{
mutex_t::scoped_lock l(m_mutex);
m_settings = s;
m_files.resize(m_settings.file_pool_size);
// replace all occurances of '\n' with ' '.
std::string::iterator i = m_settings.user_agent.begin();
while ((i = std::find(i, m_settings.user_agent.end(), '\n'))