mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 03:37:49 +02:00
use memory pool for outgoing tunnel gateway messages
This commit is contained in:
parent
0a62a962d7
commit
cdc8e463b7
3 changed files with 21 additions and 16 deletions
|
@ -38,14 +38,7 @@ namespace i2p
|
|||
|
||||
std::shared_ptr<I2NPMessage> NewI2NPTunnelMessage (bool endpoint)
|
||||
{
|
||||
if (endpoint)
|
||||
return i2p::tunnel::tunnels.NewI2NPTunnelMessage ();
|
||||
else
|
||||
{
|
||||
auto msg = new I2NPMessageBuffer<i2p::tunnel::TUNNEL_DATA_MSG_SIZE + I2NP_HEADER_SIZE + 34>(); // reserved for alignment and NTCP 16 + 6 + 12
|
||||
msg->Align (12);
|
||||
return std::shared_ptr<I2NPMessage>(msg);
|
||||
}
|
||||
return i2p::tunnel::tunnels.NewI2NPTunnelMessage (endpoint);
|
||||
}
|
||||
|
||||
std::shared_ptr<I2NPMessage> NewI2NPMessage (size_t len)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue