mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-02 03:40:12 +00:00
commit
eb3a4d0266
@ -76,12 +76,12 @@ namespace llarp
|
|||||||
0};
|
0};
|
||||||
htobe16buf(frag.data() + 2, idx);
|
htobe16buf(frag.data() + 2, idx);
|
||||||
htobe64buf(frag.data() + 4, m_MsgID);
|
htobe64buf(frag.data() + 4, m_MsgID);
|
||||||
if(idx + FragmentSize < m_Size)
|
const size_t fragsz =
|
||||||
std::copy(m_Data.begin() + idx, m_Data.begin() + idx + FragmentSize,
|
idx + FragmentSize < m_Size ? FragmentSize : m_Size - idx;
|
||||||
std::back_inserter(frag));
|
const auto sz = frag.size();
|
||||||
else
|
frag.resize(sz + fragsz);
|
||||||
std::copy(m_Data.begin() + idx, m_Data.begin() + m_Size,
|
std::copy(m_Data.begin() + idx, m_Data.begin() + idx + fragsz,
|
||||||
std::back_inserter(frag));
|
frag.begin() + sz);
|
||||||
const llarp_buffer_t pkt(frag);
|
const llarp_buffer_t pkt(frag);
|
||||||
sendpkt(pkt);
|
sendpkt(pkt);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user