mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-12 17:10:20 +03:00
use splice if queue is not semi-full
This commit is contained in:
parent
9bc595a9a2
commit
3f10f6651d
@ -412,16 +412,24 @@ namespace transport
|
|||||||
" is semi-full (size = ", m_SendQueue.size (), ", lag = ", queueLag / 1000, ", rtt = ", (int)m_RTT, ")");
|
" is semi-full (size = ", m_SendQueue.size (), ", lag = ", queueLag / 1000, ", rtt = ", (int)m_RTT, ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (auto it: msgs)
|
if (isSemiFull)
|
||||||
{
|
{
|
||||||
if (isSemiFull && it->onDrop)
|
for (auto it: msgs)
|
||||||
it->Drop (); // drop earlier because we can handle it
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
it->SetEnqueueTime (mts);
|
if (it->onDrop)
|
||||||
m_SendQueue.push_back (std::move (it));
|
it->Drop (); // drop earlier because we can handle it
|
||||||
|
else
|
||||||
|
{
|
||||||
|
it->SetEnqueueTime (mts);
|
||||||
|
m_SendQueue.push_back (std::move (it));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (auto& it: msgs) it->SetEnqueueTime (mts);
|
||||||
|
m_SendQueue.splice (m_SendQueue.end (), msgs);
|
||||||
|
}
|
||||||
if (IsEstablished ())
|
if (IsEstablished ())
|
||||||
{
|
{
|
||||||
SendQueue ();
|
SendQueue ();
|
||||||
|
Loading…
Reference in New Issue
Block a user