use memory poll for streaming

This commit is contained in:
orignal 2017-01-10 21:31:52 -05:00
parent feab95ce4b
commit 7ea0249e6e
3 changed files with 26 additions and 19 deletions

View file

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