attempt to fix #493 by keeping io_service running while there are still peer connections

This commit is contained in:
Arvid Norberg 2009-03-31 08:02:25 +00:00
parent d7eb787c88
commit 0070232f7c
3 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,7 @@ release 0.14.3
or checking, to maintain stats and renamed files
* Don't try IPv6 on windows if it's not installed
* move_storage fix
* fixed potential crash on shutdown
release 0.14.2

View File

@ -621,6 +621,10 @@ namespace libtorrent
void on_disk_write_complete(int ret, disk_io_job const& j
, peer_request r, boost::shared_ptr<torrent> t);
// keep the io_service running as long as we
// have peer connections
io_service::work m_work;
// the time when we last got a part of a
// piece packet from this peer
ptime m_last_piece;

View File

@ -76,6 +76,7 @@ namespace libtorrent
#endif
m_ses(ses)
, m_max_out_request_queue(m_ses.settings().max_out_request_queue)
, m_work(ses.m_io_service)
, m_last_piece(time_now())
, m_last_request(time_now())
, m_last_incoming_request(min_time())
@ -193,6 +194,7 @@ namespace libtorrent
#endif
m_ses(ses)
, m_max_out_request_queue(m_ses.settings().max_out_request_queue)
, m_work(ses.m_io_service)
, m_last_piece(time_now())
, m_last_request(time_now())
, m_last_incoming_request(min_time())