use SendBufferQueue for queued messages from I2P

This commit is contained in:
orignal 2020-11-29 14:59:34 -05:00
parent ff971563db
commit 746f53ba07
4 changed files with 75 additions and 67 deletions

View file

@ -111,6 +111,11 @@ namespace stream
buf = new uint8_t[len];
memcpy (buf, b, len);
}
SendBuffer (size_t l): // creat empty buffer
len(l), offset (0)
{
buf = new uint8_t[len];
}
~SendBuffer ()
{
delete[] buf;
@ -129,6 +134,7 @@ namespace stream
~SendBufferQueue () { CleanUp (); };
void Add (const uint8_t * buf, size_t len, SendHandler handler);
void Add (std::shared_ptr<SendBuffer> buf);
size_t Get (uint8_t * buf, size_t len);
size_t GetSize () const { return m_Size; };
bool IsEmpty () const { return m_Buffers.empty (); };