mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
reuse DH keys pairs from failed NTCP sessions
This commit is contained in:
parent
06f9e68169
commit
7019b6d68f
3 changed files with 23 additions and 1 deletions
|
@ -76,6 +76,12 @@ namespace i2p
|
|||
}
|
||||
}
|
||||
|
||||
void DHKeysPairSupplier::Return (i2p::data::DHKeysPair * pair)
|
||||
{
|
||||
std::unique_lock<std::mutex> l(m_AcquiredMutex);
|
||||
m_Queue.push (pair);
|
||||
}
|
||||
|
||||
Transports transports;
|
||||
|
||||
Transports::Transports ():
|
||||
|
@ -315,4 +321,9 @@ namespace i2p
|
|||
{
|
||||
return m_DHKeysPairSupplier.Acquire ();
|
||||
}
|
||||
|
||||
void Transports::ReuseDHKeysPair (i2p::data::DHKeysPair * pair)
|
||||
{
|
||||
m_DHKeysPairSupplier.Return (pair);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue