mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
send batch of I2NP messages
This commit is contained in:
parent
74c89ce06e
commit
ea353ac3ba
8 changed files with 71 additions and 6 deletions
|
@ -827,7 +827,19 @@ namespace transport
|
|||
if (msg)
|
||||
m_Data.Send (msg);
|
||||
}
|
||||
|
||||
|
||||
void SSUSession::SendI2NPMessages (const std::vector<I2NPMessage *>& msgs)
|
||||
{
|
||||
boost::asio::io_service& service = IsV6 () ? m_Server.GetServiceV6 () : m_Server.GetService ();
|
||||
service.post (std::bind (&SSUSession::PostI2NPMessages, shared_from_this (), msgs));
|
||||
}
|
||||
|
||||
void SSUSession::PostI2NPMessages (std::vector<I2NPMessage *> msgs)
|
||||
{
|
||||
for (auto it: msgs)
|
||||
if (it) m_Data.Send (it);
|
||||
}
|
||||
|
||||
void SSUSession::ProcessData (uint8_t * buf, size_t len)
|
||||
{
|
||||
m_Data.ProcessMessage (buf, len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue