fix shutdown delay issue

This commit is contained in:
Arvid Norberg 2012-04-01 00:42:04 +00:00
parent c50e8fa628
commit db65ec2fd3
1 changed files with 5 additions and 0 deletions

View File

@ -694,6 +694,9 @@ void http_connection::on_write(error_code const& e)
#if defined TORRENT_ASIO_DEBUGGING
complete_async("http_connection::on_write");
#endif
if (e == asio::error::operation_aborted) return;
if (e)
{
boost::shared_ptr<http_connection> me(shared_from_this());
@ -742,6 +745,8 @@ void http_connection::on_read(error_code const& e
TORRENT_ASSERT(m_download_quota >= 0);
}
if (e == asio::error::operation_aborted) return;
// keep ourselves alive even if the callback function
// deletes this object
boost::shared_ptr<http_connection> me(shared_from_this());