mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
limit mininal received packet size to 40 bytes
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user