remove some old leftover code from upnp
This commit is contained in:
@@ -115,9 +115,7 @@ public:
|
|||||||
, bool ignore_nonrouters);
|
, bool ignore_nonrouters);
|
||||||
~upnp();
|
~upnp();
|
||||||
|
|
||||||
void start(void* state = 0);
|
void start();
|
||||||
|
|
||||||
void* drain_state();
|
|
||||||
|
|
||||||
enum protocol_type { none = 0, udp = 1, tcp = 2 };
|
enum protocol_type { none = 0, udp = 1, tcp = 2 };
|
||||||
|
|
||||||
|
22
src/upnp.cpp
22
src/upnp.cpp
@@ -98,35 +98,15 @@ upnp::upnp(io_service& ios
|
|||||||
TORRENT_UNUSED(listen_interface);
|
TORRENT_UNUSED(listen_interface);
|
||||||
}
|
}
|
||||||
|
|
||||||
void upnp::start(void* state)
|
void upnp::start()
|
||||||
{
|
{
|
||||||
error_code ec;
|
error_code ec;
|
||||||
m_socket.open(boost::bind(&upnp::on_reply, self(), _1, _2, _3)
|
m_socket.open(boost::bind(&upnp::on_reply, self(), _1, _2, _3)
|
||||||
, m_refresh_timer.get_io_service(), ec);
|
, m_refresh_timer.get_io_service(), ec);
|
||||||
|
|
||||||
if (state)
|
|
||||||
{
|
|
||||||
upnp_state_t* s = (upnp_state_t*)state;
|
|
||||||
m_devices.swap(s->devices);
|
|
||||||
m_mappings.swap(s->mappings);
|
|
||||||
delete s;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_mappings.reserve(10);
|
m_mappings.reserve(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* upnp::drain_state()
|
|
||||||
{
|
|
||||||
upnp_state_t* s = new upnp_state_t;
|
|
||||||
s->mappings.swap(m_mappings);
|
|
||||||
|
|
||||||
for (std::set<rootdevice>::iterator i = m_devices.begin()
|
|
||||||
, end(m_devices.end()); i != end; ++i)
|
|
||||||
i->upnp_connection.reset();
|
|
||||||
s->devices.swap(m_devices);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
upnp::~upnp()
|
upnp::~upnp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user