limit number of precalculated DH pairs

This commit is contained in:
orignal 2017-01-25 11:20:15 -05:00
parent 188987a8ff
commit 4d2f26b1cd

View File

@ -101,8 +101,9 @@ namespace transport
void DHKeysPairSupplier::Return (std::shared_ptr<i2p::crypto::DHKeys> pair)
{
std::unique_lock<std::mutex> l(m_AcquiredMutex);
m_Queue.push (pair);
std::unique_lock<std::mutex>l(m_AcquiredMutex);
if ((int)m_Queue.size () < 2*m_QueueSize)
m_Queue.push (pair);
}
Transports transports;