forked from premiere/premiere-libtorrent
fixed shutdown issue when trackers times out (introduced with the timer optimization)
This commit is contained in:
parent
4a326ca1ec
commit
f05777c2c2
|
@ -64,8 +64,8 @@ namespace
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
timeout_handler::timeout_handler(io_service& ios)
|
timeout_handler::timeout_handler(io_service& ios)
|
||||||
: m_start_time(time_now())
|
: m_start_time(time_now_hires())
|
||||||
, m_read_time(time_now())
|
, m_read_time(m_start_time)
|
||||||
, m_timeout(ios)
|
, m_timeout(ios)
|
||||||
, m_completion_timeout(0)
|
, m_completion_timeout(0)
|
||||||
, m_read_timeout(0)
|
, m_read_timeout(0)
|
||||||
|
@ -76,7 +76,7 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
m_completion_timeout = completion_timeout;
|
m_completion_timeout = completion_timeout;
|
||||||
m_read_timeout = read_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;
|
if (m_abort) return;
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ namespace libtorrent
|
||||||
|
|
||||||
void timeout_handler::restart_read_timeout()
|
void timeout_handler::restart_read_timeout()
|
||||||
{
|
{
|
||||||
m_read_time = time_now();
|
m_read_time = time_now_hires();
|
||||||
}
|
}
|
||||||
|
|
||||||
void timeout_handler::cancel()
|
void timeout_handler::cancel()
|
||||||
|
@ -106,7 +106,7 @@ namespace libtorrent
|
||||||
if (error) return;
|
if (error) return;
|
||||||
if (m_completion_timeout == 0) 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 receive_timeout = now - m_read_time;
|
||||||
time_duration completion_timeout = now - m_start_time;
|
time_duration completion_timeout = now - m_start_time;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue