Skip to content

Commit

Permalink
drop earlier if delayed queue is semi-full
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Feb 1, 2024
1 parent 96cf6ca commit 8f28cee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libi2pd/Transports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,10 @@ namespace transport
}
}
for (auto& it1: msgs)
it->second.delayedMessages.push_back (it1);
if (sz > MAX_NUM_DELAYED_MESSAGES/2 && it1->onDrop)
it1->Drop (); // drop earlier because we can handle it
else
it->second.delayedMessages.push_back (it1);
}
else
{
Expand Down

0 comments on commit 8f28cee

Please sign in to comment.