SSU data receive batching

This commit is contained in:
orignal 2015-02-15 14:17:55 -05:00
parent e901307d8d
commit e3190a4ca9
5 changed files with 21 additions and 3 deletions

View file

@ -218,6 +218,7 @@ namespace transport
auto packet = it1;
if (!session || session->GetRemoteEndpoint () != packet->from) // we received packet for other session than previous
{
if (session) session->FlushData ();
auto it = m_Sessions.find (packet->from);
if (it != m_Sessions.end ())
session = it->second;
@ -235,6 +236,7 @@ namespace transport
session->ProcessNextMessage (packet->buf, packet->len, packet->from);
delete packet;
}
if (session) session->FlushData ();
}
std::shared_ptr<SSUSession> SSUServer::FindSession (std::shared_ptr<const i2p::data::RouterInfo> router) const