move buffer when insert to buffer queue. clean entire queue in one call

This commit is contained in:
orignal 2025-04-03 18:42:34 -04:00
parent 78d97179b8
commit 3be4c7217f
3 changed files with 41 additions and 25 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2024, The PurpleI2P Project
* Copyright (c) 2013-2025, The PurpleI2P Project
*
* This file is part of Purple i2pd project and licensed under BSD3
*
@ -150,7 +150,7 @@ namespace stream
SendBufferQueue (): m_Size (0) {};
~SendBufferQueue () { CleanUp (); };
void Add (std::shared_ptr<SendBuffer> buf);
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 (); };