mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
reduced memory footprint
This commit is contained in:
parent
62ca6212ce
commit
57310fdbd6
2 changed files with 6 additions and 4 deletions
|
@ -525,7 +525,7 @@ namespace transport
|
|||
memcpy (m_ReceiveBuffer, nextBlock, m_ReceiveBufferOffset);
|
||||
|
||||
// try to read more
|
||||
if (numReloads < 5)
|
||||
if (numReloads < 16) // ~16K
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
size_t moreBytes = m_Socket.available(ec);
|
||||
|
@ -541,9 +541,12 @@ namespace transport
|
|||
return;
|
||||
}
|
||||
m_NumReceivedBytes += moreBytes;
|
||||
i2p::transport::transports.UpdateReceivedBytes (bytes_transferred);
|
||||
m_ReceiveBufferOffset += moreBytes;
|
||||
numReloads++;
|
||||
}
|
||||
}
|
||||
else
|
||||
break; // no more data
|
||||
}
|
||||
}
|
||||
while (m_ReceiveBufferOffset >= 16);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue