mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-24 01:46:36 +02:00
limit number of precalculated DH pairs
This commit is contained in:
parent
188987a8ff
commit
4d2f26b1cd
1 changed files with 3 additions and 2 deletions
|
@ -102,6 +102,7 @@ namespace transport
|
||||||
void DHKeysPairSupplier::Return (std::shared_ptr<i2p::crypto::DHKeys> pair)
|
void DHKeysPairSupplier::Return (std::shared_ptr<i2p::crypto::DHKeys> pair)
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex>l(m_AcquiredMutex);
|
std::unique_lock<std::mutex>l(m_AcquiredMutex);
|
||||||
|
if ((int)m_Queue.size () < 2*m_QueueSize)
|
||||||
m_Queue.push (pair);
|
m_Queue.push (pair);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue