mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2024-11-16 00:12:43 +00:00
update I2NP header after all fragments received
This commit is contained in:
parent
67e501f5c7
commit
db5e90787c
@ -842,7 +842,6 @@ namespace transport
|
|||||||
// same format as I2NP message block
|
// same format as I2NP message block
|
||||||
msg->len = msg->offset + len + 7;
|
msg->len = msg->offset + len + 7;
|
||||||
memcpy (msg->GetNTCP2Header (), buf, len);
|
memcpy (msg->GetNTCP2Header (), buf, len);
|
||||||
msg->FromNTCP2 ();
|
|
||||||
std::shared_ptr<SSU2IncompleteMessage> m;
|
std::shared_ptr<SSU2IncompleteMessage> m;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
auto it = m_IncompleteMessages.find (msgID);
|
auto it = m_IncompleteMessages.find (msgID);
|
||||||
@ -862,6 +861,7 @@ namespace transport
|
|||||||
if (found && ConcatOutOfSequenceFragments (m))
|
if (found && ConcatOutOfSequenceFragments (m))
|
||||||
{
|
{
|
||||||
// we have all follow-on fragments already
|
// we have all follow-on fragments already
|
||||||
|
m->msg->FromNTCP2 ();
|
||||||
m_Handler.PutNextMessage (std::move (m->msg));
|
m_Handler.PutNextMessage (std::move (m->msg));
|
||||||
m_IncompleteMessages.erase (it);
|
m_IncompleteMessages.erase (it);
|
||||||
}
|
}
|
||||||
@ -882,6 +882,7 @@ namespace transport
|
|||||||
it->second->msg->Concat (buf + 5, len - 5);
|
it->second->msg->Concat (buf + 5, len - 5);
|
||||||
if (isLast)
|
if (isLast)
|
||||||
{
|
{
|
||||||
|
it->second->msg->FromNTCP2 ();
|
||||||
m_Handler.PutNextMessage (std::move (it->second->msg));
|
m_Handler.PutNextMessage (std::move (it->second->msg));
|
||||||
m_IncompleteMessages.erase (it);
|
m_IncompleteMessages.erase (it);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user