mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
limit mininal received packet size to 40 bytes
This commit is contained in:
parent
b4484c8e8f
commit
140146e433
2 changed files with 10 additions and 2 deletions
|
@ -283,8 +283,15 @@ namespace transport
|
|||
// but better to find out which host were sent it and mark that router as unreachable
|
||||
{
|
||||
i2p::transport::transports.UpdateReceivedBytes (bytes_transferred);
|
||||
if (bytes_transferred < SSU2_MIN_RECEIVED_PACKET_SIZE)
|
||||
{
|
||||
// drop too short packets
|
||||
m_PacketsPool.ReleaseMt (packet);
|
||||
Receive (socket);
|
||||
return;
|
||||
}
|
||||
packet->len = bytes_transferred;
|
||||
|
||||
|
||||
boost::system::error_code ec;
|
||||
size_t moreBytes = socket.available (ec);
|
||||
if (!ec && moreBytes)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue