remove some old leftover code from upnp

This commit is contained in:
arvidn 2015-08-16 12:21:39 -04:00
parent 9a0092c120
commit b1a3a36eae
2 changed files with 2 additions and 24 deletions

View File

@ -115,9 +115,7 @@ public:
, bool ignore_nonrouters);
~upnp();
void start(void* state = 0);
void* drain_state();
void start();
enum protocol_type { none = 0, udp = 1, tcp = 2 };

View File

@ -98,35 +98,15 @@ upnp::upnp(io_service& ios
TORRENT_UNUSED(listen_interface);
}
void upnp::start(void* state)
void upnp::start()
{
error_code ec;
m_socket.open(boost::bind(&upnp::on_reply, self(), _1, _2, _3)
, 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);
}
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()
{
}