mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
memory pool for IdentityEx
This commit is contained in:
parent
5ad9c8e740
commit
55b2f2c625
7 changed files with 46 additions and 67 deletions
|
@ -50,7 +50,7 @@ namespace data
|
|||
void LeaseSet::ReadFromBuffer (bool readIdentity, bool verifySignature)
|
||||
{
|
||||
if (readIdentity || !m_Identity)
|
||||
m_Identity = std::make_shared<IdentityEx>(m_Buffer, m_BufferLen);
|
||||
m_Identity = netdb.NewIdentity (m_Buffer, m_BufferLen);
|
||||
size_t size = m_Identity->GetFullLen ();
|
||||
if (size + 256 > m_BufferLen)
|
||||
{
|
||||
|
@ -317,7 +317,7 @@ namespace data
|
|||
std::shared_ptr<const IdentityEx> identity;
|
||||
if (readIdentity || !GetIdentity ())
|
||||
{
|
||||
identity = std::make_shared<IdentityEx>(buf, len);
|
||||
identity = netdb.NewIdentity (buf, len);
|
||||
SetIdentity (identity);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue