added disk cache for write operations

This commit is contained in:
Arvid Norberg
2008-02-08 10:22:05 +00:00
parent 196f9c3544
commit 8cf0510144
18 changed files with 645 additions and 166 deletions

View File

@@ -552,6 +552,8 @@ namespace detail
)
: m_send_buffers(send_buffer_size)
, m_files(40)
, m_io_service()
, m_disk_thread(m_io_service)
, m_half_open(m_io_service)
, m_download_channel(m_io_service, peer_connection::download_channel)
#ifdef TORRENT_VERBOSE_BANDWIDTH_LIMIT
@@ -807,6 +809,8 @@ namespace detail
// less than 5 seconds unchoke interval is insane
TORRENT_ASSERT(s.unchoke_interval >= 5);
if (m_settings.cache_size != s.cache_size)
m_disk_thread.set_cache_size(s.cache_size);
m_settings = s;
m_files.resize(m_settings.file_pool_size);
if (!s.auto_upload_slots) m_allowed_upload_slots = m_max_uploads;