mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
reduced memory footprint
This commit is contained in:
parent
62ca6212ce
commit
57310fdbd6
@ -525,7 +525,7 @@ namespace transport
|
|||||||
memcpy (m_ReceiveBuffer, nextBlock, m_ReceiveBufferOffset);
|
memcpy (m_ReceiveBuffer, nextBlock, m_ReceiveBufferOffset);
|
||||||
|
|
||||||
// try to read more
|
// try to read more
|
||||||
if (numReloads < 5)
|
if (numReloads < 16) // ~16K
|
||||||
{
|
{
|
||||||
boost::system::error_code ec;
|
boost::system::error_code ec;
|
||||||
size_t moreBytes = m_Socket.available(ec);
|
size_t moreBytes = m_Socket.available(ec);
|
||||||
@ -541,9 +541,12 @@ namespace transport
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_NumReceivedBytes += moreBytes;
|
m_NumReceivedBytes += moreBytes;
|
||||||
|
i2p::transport::transports.UpdateReceivedBytes (bytes_transferred);
|
||||||
m_ReceiveBufferOffset += moreBytes;
|
m_ReceiveBufferOffset += moreBytes;
|
||||||
numReloads++;
|
numReloads++;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
break; // no more data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (m_ReceiveBufferOffset >= 16);
|
while (m_ReceiveBufferOffset >= 16);
|
||||||
|
@ -35,12 +35,11 @@ namespace transport
|
|||||||
};
|
};
|
||||||
|
|
||||||
const size_t NTCP_MAX_MESSAGE_SIZE = 16384;
|
const size_t NTCP_MAX_MESSAGE_SIZE = 16384;
|
||||||
const size_t NTCP_BUFFER_SIZE = 4160; // fits 4 tunnel messages (4*1028)
|
const size_t NTCP_BUFFER_SIZE = 1028; // fits 1 tunnel data message
|
||||||
const int NTCP_CONNECT_TIMEOUT = 5; // 5 seconds
|
const int NTCP_CONNECT_TIMEOUT = 5; // 5 seconds
|
||||||
const int NTCP_TERMINATION_TIMEOUT = 120; // 2 minutes
|
const int NTCP_TERMINATION_TIMEOUT = 120; // 2 minutes
|
||||||
const int NTCP_TERMINATION_CHECK_TIMEOUT = 30; // 30 seconds
|
const int NTCP_TERMINATION_CHECK_TIMEOUT = 30; // 30 seconds
|
||||||
const size_t NTCP_DEFAULT_PHASE3_SIZE = 2/*size*/ + i2p::data::DEFAULT_IDENTITY_SIZE/*387*/ + 4/*ts*/ + 15/*padding*/ + 40/*signature*/; // 448
|
const size_t NTCP_DEFAULT_PHASE3_SIZE = 2/*size*/ + i2p::data::DEFAULT_IDENTITY_SIZE/*387*/ + 4/*ts*/ + 15/*padding*/ + 40/*signature*/; // 448
|
||||||
const int NTCP_BAN_EXPIRATION_TIMEOUT = 70; // in second
|
|
||||||
const int NTCP_CLOCK_SKEW = 60; // in seconds
|
const int NTCP_CLOCK_SKEW = 60; // in seconds
|
||||||
const int NTCP_MAX_OUTGOING_QUEUE_SIZE = 200; // how many messages we can queue up
|
const int NTCP_MAX_OUTGOING_QUEUE_SIZE = 200; // how many messages we can queue up
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user