mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
eliminate extra copy of I2NP messages list
This commit is contained in:
parent
23e66671c2
commit
4c90a88b85
4 changed files with 9 additions and 9 deletions
|
@ -453,9 +453,11 @@ namespace transport
|
|||
SendMessages (ident, { msg });
|
||||
}
|
||||
|
||||
void Transports::SendMessages (const i2p::data::IdentHash& ident, const std::list<std::shared_ptr<i2p::I2NPMessage> >& msgs)
|
||||
void Transports::SendMessages (const i2p::data::IdentHash& ident, std::list<std::shared_ptr<i2p::I2NPMessage> >& msgs)
|
||||
{
|
||||
m_Service->post (std::bind (&Transports::PostMessages, this, ident, msgs));
|
||||
std::list<std::shared_ptr<i2p::I2NPMessage> > msgs1;
|
||||
msgs.swap (msgs1);
|
||||
SendMessages (ident, std::move (msgs1));
|
||||
}
|
||||
|
||||
void Transports::SendMessages (const i2p::data::IdentHash& ident, std::list<std::shared_ptr<i2p::I2NPMessage> >&& msgs)
|
||||
|
@ -888,8 +890,7 @@ namespace transport
|
|||
else
|
||||
session->SetTerminationTimeout (10); // most likely it's publishing, no follow-up messages expected, set timeout to 10 seconds
|
||||
peer->sessions.push_back (session);
|
||||
session->SendI2NPMessages (peer->delayedMessages);
|
||||
peer->delayedMessages.clear ();
|
||||
session->SendI2NPMessages (peer->delayedMessages); // send and clear
|
||||
}
|
||||
else // incoming connection or peer test
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue