mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-31 13:14:13 +00:00
send frame when it exceeds 16K
This commit is contained in:
parent
c01fd3299f
commit
c158bbe90a
@ -1152,10 +1152,13 @@ namespace transport
|
|||||||
msgs.push_back (msg);
|
msgs.push_back (msg);
|
||||||
s += (len + 3);
|
s += (len + 3);
|
||||||
m_SendQueue.pop_front ();
|
m_SendQueue.pop_front ();
|
||||||
|
if (s >= NTCP2_SEND_AFTER_FRAME_SIZE)
|
||||||
|
break; // send frame right a way
|
||||||
}
|
}
|
||||||
else if (len + 3 > NTCP2_UNENCRYPTED_FRAME_MAX_SIZE)
|
else if (len + 3 > NTCP2_UNENCRYPTED_FRAME_MAX_SIZE)
|
||||||
{
|
{
|
||||||
LogPrint (eLogError, "NTCP2: I2NP message of size ", len, " can't be sent. Dropped");
|
LogPrint (eLogError, "NTCP2: I2NP message of size ", len, " can't be sent. Dropped");
|
||||||
|
msg->Drop ();
|
||||||
m_SendQueue.pop_front ();
|
m_SendQueue.pop_front ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2022, The PurpleI2P Project
|
* Copyright (c) 2013-2024, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
@ -28,6 +28,7 @@ namespace transport
|
|||||||
{
|
{
|
||||||
|
|
||||||
const size_t NTCP2_UNENCRYPTED_FRAME_MAX_SIZE = 65519;
|
const size_t NTCP2_UNENCRYPTED_FRAME_MAX_SIZE = 65519;
|
||||||
|
const size_t NTCP2_SEND_AFTER_FRAME_SIZE = 16386; // send frame when exceeds this size
|
||||||
const size_t NTCP2_SESSION_REQUEST_MAX_SIZE = 287;
|
const size_t NTCP2_SESSION_REQUEST_MAX_SIZE = 287;
|
||||||
const size_t NTCP2_SESSION_CREATED_MAX_SIZE = 287;
|
const size_t NTCP2_SESSION_CREATED_MAX_SIZE = 287;
|
||||||
const int NTCP2_MAX_PADDING_RATIO = 6; // in %
|
const int NTCP2_MAX_PADDING_RATIO = 6; // in %
|
||||||
|
Loading…
x
Reference in New Issue
Block a user