mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
always use shared_ptr for I2NPMessage
This commit is contained in:
parent
885d57138a
commit
06c4aca490
12 changed files with 63 additions and 84 deletions
|
@ -15,7 +15,7 @@ namespace transport
|
|||
if (msg->len + fragmentSize > msg->maxLen)
|
||||
{
|
||||
LogPrint (eLogInfo, "SSU I2NP message size ", msg->maxLen, " is not enough");
|
||||
auto newMsg = ToSharedI2NPMessage(NewI2NPMessage ());
|
||||
auto newMsg = NewI2NPMessage ();
|
||||
*newMsg = *msg;
|
||||
msg = newMsg;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ namespace transport
|
|||
if (it == m_IncompleteMessages.end ())
|
||||
{
|
||||
// create new message
|
||||
auto msg = ToSharedI2NPMessage (NewI2NPShortMessage ());
|
||||
auto msg = NewI2NPShortMessage ();
|
||||
msg->len -= I2NP_SHORT_HEADER_SIZE;
|
||||
it = m_IncompleteMessages.insert (std::make_pair (msgID,
|
||||
std::unique_ptr<IncompleteMessage>(new IncompleteMessage (msg)))).first;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue