fix overflow issue in default disk write queue size limit

This commit is contained in:
Arvid Norberg 2011-09-14 06:22:45 +00:00
parent fb89e58901
commit 6271ee58f6
2 changed files with 4 additions and 4 deletions

View File

@ -1517,10 +1517,9 @@ namespace libtorrent
if (m_exceeded_write_queue)
{
int low_watermark = m_settings.max_queued_disk_bytes_low_watermark == 0
? m_settings.max_queued_disk_bytes * 7 / 8
|| m_settings.max_queued_disk_bytes_low_watermark >= m_settings.max_queued_disk_bytes
? size_type(m_settings.max_queued_disk_bytes) * 7 / 8
: m_settings.max_queued_disk_bytes_low_watermark;
if (low_watermark >= m_settings.max_queued_disk_bytes)
low_watermark = m_settings.max_queued_disk_bytes * 7 / 8;
if (m_queue_buffer_size < low_watermark
|| m_settings.max_queued_disk_bytes == 0)

View File

@ -3283,7 +3283,8 @@ namespace aux {
}
int low_watermark = m_settings.max_queued_disk_bytes_low_watermark == 0
? m_settings.max_queued_disk_bytes * 7 / 8
|| m_settings.max_queued_disk_bytes_low_watermark >= m_settings.max_queued_disk_bytes
? size_type(m_settings.max_queued_disk_bytes) * 7 / 8
: m_settings.max_queued_disk_bytes_low_watermark;
if (now - m_last_log_rotation > hours(1))