mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
use memory poll for streaming
This commit is contained in:
parent
feab95ce4b
commit
7ea0249e6e
3 changed files with 26 additions and 19 deletions
|
@ -18,6 +18,7 @@
|
|||
#include "I2NPProtocol.h"
|
||||
#include "Garlic.h"
|
||||
#include "Tunnel.h"
|
||||
#include "util.h" // MemoryPool
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
|
@ -234,6 +235,9 @@ namespace stream
|
|||
|
||||
/** set max connections per minute per destination */
|
||||
void SetMaxConnsPerMinute(const uint32_t conns);
|
||||
|
||||
Packet * NewPacket () { return m_PacketsPool.Acquire (); };
|
||||
void DeletePacket (Packet * p) { if (p) m_PacketsPool.Release (p); };
|
||||
|
||||
private:
|
||||
|
||||
|
@ -269,7 +273,9 @@ namespace stream
|
|||
/** banned identities */
|
||||
std::vector<i2p::data::IdentHash> m_Banned;
|
||||
uint64_t m_LastBanClear;
|
||||
|
||||
|
||||
i2p::util::MemoryPool<Packet> m_PacketsPool;
|
||||
|
||||
public:
|
||||
|
||||
i2p::data::GzipInflator m_Inflator;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue