hack to fix an issue in natpmp and upnp

This commit is contained in:
Arvid Norberg 2010-12-24 03:30:52 +00:00
parent 8be38c41d7
commit 9c3076481d
2 changed files with 6 additions and 0 deletions

View File

@ -73,6 +73,10 @@ natpmp::natpmp(io_service& ios, address const& listen_interface
, m_disabled(false)
, m_abort(false)
{
// unfortunately async operations rely on the storage
// for this array not to be reallocated, by passing
// around pointers to its elements. so reserve size for now
m_mappings.reserve(10);
rebind(listen_interface);
}

View File

@ -88,6 +88,8 @@ upnp::upnp(io_service& ios, connection_queue& cc
m_mappings.swap(s->mappings);
delete s;
}
m_mappings.reserve(10);
}
void* upnp::drain_state()