Merge remote-tracking branch 'origin/master' into debian/sid

This commit is contained in:
Jason Rhinelander 2019-08-30 13:13:45 -03:00
commit 53978fa48a

View File

@ -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);
} }