1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 08:14:15 +00:00

start new tunnel message if remining is too small

This commit is contained in:
orignal 2020-06-12 16:03:12 -04:00
parent 6a0174293e
commit 5993cc857a

View File

@ -66,7 +66,7 @@ namespace tunnel
// length of bytes doesn't fit full tunnel message
// every follow-on fragment adds 7 bytes
size_t nonFit = (fullMsgLen + numFollowOnFragments*7) % TUNNEL_DATA_MAX_PAYLOAD_SIZE;
if (!nonFit || nonFit > m_RemainingSize)
if (!nonFit || nonFit > m_RemainingSize || m_RemainingSize < fullMsgLen/5)
{
CompleteCurrentTunnelDataMessage ();
CreateCurrentTunnelDataMessage ();