fixed shutdown issue when trackers times out (introduced with the timer optimization)

This commit is contained in:
Arvid Norberg 2009-05-25 23:12:06 +00:00
parent 4a326ca1ec
commit f05777c2c2
1 changed files with 5 additions and 5 deletions

View File

@ -64,8 +64,8 @@ namespace
namespace libtorrent
{
timeout_handler::timeout_handler(io_service& ios)
: m_start_time(time_now())
, m_read_time(time_now())
: m_start_time(time_now_hires())
, m_read_time(m_start_time)
, m_timeout(ios)
, m_completion_timeout(0)
, m_read_timeout(0)
@ -76,7 +76,7 @@ namespace libtorrent
{
m_completion_timeout = completion_timeout;
m_read_timeout = read_timeout;
m_start_time = m_read_time = time_now();
m_start_time = m_read_time = time_now_hires();
if (m_abort) return;
@ -90,7 +90,7 @@ namespace libtorrent
void timeout_handler::restart_read_timeout()
{
m_read_time = time_now();
m_read_time = time_now_hires();
}
void timeout_handler::cancel()
@ -106,7 +106,7 @@ namespace libtorrent
if (error) return;
if (m_completion_timeout == 0) return;
ptime now(time_now());
ptime now = time_now_hires();
time_duration receive_timeout = now - m_read_time;
time_duration completion_timeout = now - m_start_time;