forked from premiere/premiere-libtorrent
close connection in upnp::on_upnp_xml and added abort/closing returns
This commit is contained in:
parent
ee9e0abb1a
commit
74ecf63906
|
@ -882,6 +882,8 @@ void http_connection::on_assign_bandwidth(error_code const& e)
|
|||
m_limiter_timer_active = false;
|
||||
if (e) return;
|
||||
|
||||
if (m_abort) return;
|
||||
|
||||
if (m_download_quota > 0) return;
|
||||
|
||||
m_download_quota = m_rate_limit / 4;
|
||||
|
|
|
@ -955,6 +955,8 @@ void upnp::on_upnp_xml(error_code const& e
|
|||
d.upnp_connection.reset();
|
||||
}
|
||||
|
||||
if (m_closing) return;
|
||||
|
||||
if (e && e != boost::asio::error::eof)
|
||||
{
|
||||
#ifndef TORRENT_DISABLE_LOGGING
|
||||
|
@ -1059,6 +1061,7 @@ void upnp::on_upnp_xml(error_code const& e
|
|||
return;
|
||||
}
|
||||
|
||||
if (d.upnp_connection) d.upnp_connection->close();
|
||||
d.upnp_connection = std::make_shared<http_connection>(m_io_service
|
||||
, m_resolver
|
||||
, std::bind(&upnp::on_upnp_get_ip_address_response, self(), _1, _2
|
||||
|
@ -1566,6 +1569,8 @@ void upnp::on_expire(error_code const& ec)
|
|||
COMPLETE_ASYNC("upnp::on_expire");
|
||||
if (ec) return;
|
||||
|
||||
if (m_closing) return;
|
||||
|
||||
time_point const now = aux::time_now();
|
||||
time_point next_expire = max_time();
|
||||
|
||||
|
|
Loading…
Reference in New Issue