Browse Source

start new tunnel message if remining is too small

pull/1535/head
orignal 4 years ago
parent
commit
5993cc857a
  1. 2
      libi2pd/TunnelGateway.cpp

2
libi2pd/TunnelGateway.cpp

@ -66,7 +66,7 @@ namespace tunnel @@ -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 ();

Loading…
Cancel
Save