mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
stop using auto
This commit is contained in:
parent
43be363542
commit
21b3576b66
@ -205,7 +205,7 @@ namespace tunnel
|
|||||||
if (it->second.fragmentNum == msg.nextFragmentNum)
|
if (it->second.fragmentNum == msg.nextFragmentNum)
|
||||||
{
|
{
|
||||||
LogPrint (eLogWarning, "TunnelMessage: Out-of-sequence fragment ", (int)it->second.fragmentNum, " of message ", msgID, " found");
|
LogPrint (eLogWarning, "TunnelMessage: Out-of-sequence fragment ", (int)it->second.fragmentNum, " of message ", msgID, " found");
|
||||||
auto size = it->second.data->GetLength ();
|
size_t size = it->second.data->GetLength ();
|
||||||
if (msg.data->len + size > msg.data->maxLen)
|
if (msg.data->len + size > msg.data->maxLen)
|
||||||
{
|
{
|
||||||
LogPrint (eLogWarning, "TunnelMessage: Tunnel endpoint I2NP message size ", msg.data->maxLen, " is not enough");
|
LogPrint (eLogWarning, "TunnelMessage: Tunnel endpoint I2NP message size ", msg.data->maxLen, " is not enough");
|
||||||
@ -235,7 +235,7 @@ namespace tunnel
|
|||||||
LogPrint (eLogInfo, "TunnelMessage: message expired");
|
LogPrint (eLogInfo, "TunnelMessage: message expired");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto typeID = msg.data->GetTypeID ();
|
uint8_t typeID = msg.data->GetTypeID ();
|
||||||
LogPrint (eLogDebug, "TunnelMessage: handle fragment of ", msg.data->GetLength (), " bytes, msg type ", (int)typeID);
|
LogPrint (eLogDebug, "TunnelMessage: handle fragment of ", msg.data->GetLength (), " bytes, msg type ", (int)typeID);
|
||||||
// catch RI or reply with new list of routers
|
// catch RI or reply with new list of routers
|
||||||
if ((IsRouterInfoMsg (msg.data) || typeID == eI2NPDatabaseSearchReply) &&
|
if ((IsRouterInfoMsg (msg.data) || typeID == eI2NPDatabaseSearchReply) &&
|
||||||
|
@ -49,7 +49,7 @@ namespace tunnel
|
|||||||
|
|
||||||
// create fragments
|
// create fragments
|
||||||
std::shared_ptr<I2NPMessage> msg = block.data;
|
std::shared_ptr<I2NPMessage> msg = block.data;
|
||||||
auto fullMsgLen = diLen + msg->GetLength () + 2; // delivery instructions + payload + 2 bytes length
|
size_t fullMsgLen = diLen + msg->GetLength () + 2; // delivery instructions + payload + 2 bytes length
|
||||||
if (fullMsgLen <= m_RemainingSize)
|
if (fullMsgLen <= m_RemainingSize)
|
||||||
{
|
{
|
||||||
// message fits. First and last fragment
|
// message fits. First and last fragment
|
||||||
@ -66,10 +66,10 @@ namespace tunnel
|
|||||||
{
|
{
|
||||||
if (!messageCreated) // check if we should complete previous message
|
if (!messageCreated) // check if we should complete previous message
|
||||||
{
|
{
|
||||||
auto numFollowOnFragments = fullMsgLen / TUNNEL_DATA_MAX_PAYLOAD_SIZE;
|
size_t numFollowOnFragments = fullMsgLen / TUNNEL_DATA_MAX_PAYLOAD_SIZE;
|
||||||
// length of bytes don't fit full tunnel message
|
// length of bytes don't fit full tunnel message
|
||||||
// every follow-on fragment adds 7 bytes
|
// every follow-on fragment adds 7 bytes
|
||||||
auto nonFit = (fullMsgLen + numFollowOnFragments*7) % TUNNEL_DATA_MAX_PAYLOAD_SIZE;
|
size_t nonFit = (fullMsgLen + numFollowOnFragments*7) % TUNNEL_DATA_MAX_PAYLOAD_SIZE;
|
||||||
if (!nonFit || nonFit > m_RemainingSize)
|
if (!nonFit || nonFit > m_RemainingSize)
|
||||||
{
|
{
|
||||||
CompleteCurrentTunnelDataMessage ();
|
CompleteCurrentTunnelDataMessage ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user