another try to fix the upnp problems

This commit is contained in:
Arvid Norberg 2009-07-01 04:02:16 +00:00
parent db165942a7
commit fb6130bd95
1 changed files with 12 additions and 0 deletions

View File

@ -247,6 +247,8 @@ void upnp::resend_request(error_code const& e)
{
if (e) return;
boost::intrusive_ptr<upnp> me(self());
mutex_t::scoped_lock l(m_mutex);
if (m_closing) return;
@ -303,6 +305,8 @@ void upnp::resend_request(error_code const& e)
void upnp::on_reply(udp::endpoint const& from, char* buffer
, std::size_t bytes_transferred)
{
boost::intrusive_ptr<upnp> me(self());
mutex_t::scoped_lock l(m_mutex);
using namespace libtorrent::detail;
@ -653,6 +657,8 @@ void upnp::update_map(rootdevice& d, int i, mutex_t::scoped_lock& l)
if (d.upnp_connection) return;
boost::intrusive_ptr<upnp> me(self());
mapping_t& m = d.mapping[i];
if (m.action == mapping_t::action_none
@ -825,6 +831,8 @@ void upnp::on_upnp_xml(error_code const& e
, libtorrent::http_parser const& p, rootdevice& d
, http_connection& c)
{
boost::intrusive_ptr<upnp> me(self());
mutex_t::scoped_lock l(m_mutex);
TORRENT_ASSERT(d.magic == 1337);
@ -1056,6 +1064,8 @@ void upnp::on_upnp_map_response(error_code const& e
, libtorrent::http_parser const& p, rootdevice& d, int mapping
, http_connection& c)
{
boost::intrusive_ptr<upnp> me(self());
mutex_t::scoped_lock l(m_mutex);
TORRENT_ASSERT(d.magic == 1337);
@ -1212,6 +1222,8 @@ void upnp::on_upnp_unmap_response(error_code const& e
, libtorrent::http_parser const& p, rootdevice& d, int mapping
, http_connection& c)
{
boost::intrusive_ptr<upnp> me(self());
mutex_t::scoped_lock l(m_mutex);
TORRENT_ASSERT(d.magic == 1337);