mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
drop earlier if outgoing queue is semi-full
This commit is contained in:
@@ -351,8 +351,12 @@ namespace transport
|
||||
void SSU2Session::PostI2NPMessages (std::vector<std::shared_ptr<I2NPMessage> > msgs)
|
||||
{
|
||||
if (m_State == eSSU2SessionStateTerminated) return;
|
||||
bool isSemiFull = m_SendQueue.size () > SSU2_MAX_OUTGOING_QUEUE_SIZE/2;
|
||||
for (auto it: msgs)
|
||||
m_SendQueue.push_back (std::move (it));
|
||||
if (isSemiFull && it->onDrop)
|
||||
it->Drop (); // drop earlier because we can handle it
|
||||
else
|
||||
m_SendQueue.push_back (std::move (it));
|
||||
SendQueue ();
|
||||
|
||||
if (m_SendQueue.size () > 0) // windows is full
|
||||
|
||||
Reference in New Issue
Block a user